Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/08/2008, 12:09
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 3 meses
Puntos: 772
Respuesta: javascript de pais que Coincida con el Codigo de Area

Hola AngelofHope

Un ejemplo:

Código PHP:
<html>
<
head>
<
script type="text/javascript">
var 
cod = ['ES','CO','GU'];
var 
pa = ['España','Colombia','Guatemala'];
function 
validar(frm) {
  
frm.codigo.value;
  
frm.pais.value;
  for (
i=0i<cod.lengthi++) // averiguar indice de código
    
if (cod[i]==c) break
  if (
pa[i]!=p) {
    
alert('Error');
    return 
false;
  }
}
</script>
</head>
<body>
<form onsubmit = "return validar(this)">
<input type="text" name="codigo" />
<input type="text" name="pais" />
<input type="submit" />
</form>
</body>
</html> 
Saludos,