function checkform(){ var arrnames = new Array(9); var arrerrores = new Array(9); arrnames[0] = "nombre" arrnames[1] = "apellidos" arrnames[2] = "direccion" arrnames[3] = "ciudad" arrnames[4] = "pais" arrnames[5] = "cursoelegido" arrnames[6] = "cursosdesde" arrnames[7] = "cursoshasta" arrnames[8] = "tipoalojamiento" arrnames[9] = "conocimientosespanol" arrerrores[0] = "You must enter Name"; arrerrores[1] = "You must enter Last name"; arrerrores[2] = "Write your address, please"; arrerrores[3] = "City has to be especified"; arrerrores[4] = "You must write your Country"; arrerrores[5] = "You must select at least one course from the list"; arrerrores[6] = "You must write date of course"; arrerrores[7] = "You must write date of course"; arrerrores[8] = "Especify Accommodation, please"; arrerrores[9] = "You must choose an approximate level" // cas5 -> el select multiple for(a=0;a<10;a++) { if(a==5) { if(document.registro[arrnames[a]].selectedIndex == -1) { alert(arrerrores[a]); document.registro[arrnames[a]].focus(); return false; } } else { if(document.registro[arrnames[a]].value == "") { alert(arrerrores[a]); document.registro[arrnames[a]].focus(); return false; } } } } function cpension(valor){ if(valor == "Individual en Familia" || valor == "Doble en Familia" || valor == "Individual en Residencia" || valor == "Doble en Residencia") { document.registro.pension.disabled = false; document.registro.pension.focus(); } else { document.registro.pension.disabled = true; } if(valor == "Sin Alojamiento") { document.registro.alojamientodesde.disabled = true; document.registro.alojamientohasta.disabled = true; document.registro.alojamientosemanas.disabled = true; } else { document.registro.alojamientodesde.disabled = false; document.registro.alojamientohasta.disabled = false; document.registro.alojamientosemanas.disabled = false; } } function cgimnasio(valor){ if(valor != "Si") { document.registro.gimnasiosemanas.disabled = true; } else { document.registro.gimnasiosemanas.disabled = false; document.registro.gimnasiosemanas.focus(); } }