[OT] Javascript: Validacion complicada - Completo

From: Date: Tue, 23 Oct 2001 14:30:15 +0000
Subject: [OT] Javascript: Validacion complicada - Completo
Groups: php.general.es 
Request: Send a blank email to general-es+get-15097@lists.php.net to get a copy of this message
----- Original Message ----- From: "Jaime Abeledo - mAs impacto" <jabeledo@masimpacto.com> To: <lista@phpes.com> Sent: Tuesday, October 23, 2001 4:14 PM Subject: [PHP-ES] [OT] Javascript: Validacion complicada Hola lista: Ente todo perdón por el Off Topic, pero tengo un problema que no soy capaz de arreglar. Este es el código: <script language="javascript"> <!-- function codpos_espana (theform){ // alert(theform.usu_form[pais].options[theform.usu_form[pais].selectedIndex].v alue) if( theform.usu_form[cp].value != "" && theform.usu_form[pais].options[theform.usu_form[pais].selectedIndex].value != "ESPAÑA"){ // theform.usu_form[cp].value = "" // theform.usu_form[cp].focus() alert("Solo debe introducir el\nCÓDIGO POSTAL si el país es España") } } --> </script> <form name="formualrio1" method="POST" action="" > <input type="text" name="usu_form[email]" size="40" value="" > <input type="text" name="usu_form[nombre]" size="30" value="" > <select name="usu_form[pais]" style="FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt" onchange="comprueba(this.form)" > <option >ALBANIA</option> <option >ANDORRA</option> <option >ALEMANIA</option> <option >ANTIGUA Y BARBUDA</option> <option ESPAÑA</option> <option >FINLANDIA</option> <option >FRANCIA</option> <option >OTRO PAÍS</option></select> <input type="text" name="usu_form[apellidos]" size="40" value="" > <input type="text" name="usu_form[cp]" size="5" value="" maxlenght="5" > </form> y cuando hago una selección en la lista deplegable me da un error JavaScript del tipo: "cp no está definido" en la line que tengo marcada en el script. Alguien me podría ayudar? Gracias ******************************** Jaime Abeledo mAs impacto networks - Grupo Radio Vigo Dpto. Programación Avda/ García Barbón, 90 - 2ª planta - oficina i 36201 VIGO Tfno. 902 112425 http://www.masimpacto.com http://www.galiciahosting.com Para cualquier incidencia utiliza nuestro ticket system http://www.galiciahosting.com/soporte

« previous php.general.es (#15097) next »