Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/01/2005, 15:49
Avatar de living
living
 
Fecha de Ingreso: mayo-2004
Mensajes: 1.266
Antigüedad: 20 años
Puntos: 2
Código HTML:
<html> 
<head> 
<title>Untitled</title> 

<script language=JavaScript type=text/javascript> 
<!-- 
String.prototype.itsWhitespace = function(){ 
    return this.search(/S/g) == -1 ? true : false 
} 

var msk_txt = /CAMPOd/ 
function check_txt(current_form){ 
    var valores="<?=$cadenaArray?>";
    var its_ok = 0 
    var campoValido=true;
    for(var ctr = 0; ctr < current_form.length; ctr++){ 

       if(msk_txt.test(current_form[ctr].name)){ 

if(current_form[ctr].value.itsWhitespace()){ 
        its_ok++ 
}else{ 
} 
if (current_form[ctr].name=="CAMPO1" && valores.indexOf(current_form[ctr].value)!=-1){
   campoValido=false;
  }
}    

} 
if (!campoValido){
   alert("El CAMPO no es válido");
   return;
}
if(its_ok == 0){ 
    // Enviamos el formulario 
    current_form.submit() 
}else{ 
    alert("Por favor rellene todos los campos ") 
} 
} 

//--> 
</script> 

</head> 
<body> 
<form action="formulario.php" method="post" name="form1" onsubmit="return false"> 
<input  type="text" name="CAMPO1" > 
<input  type="text" name="CAMPO2" > 
<input  type="text" name="CAMPO3" ><br> 
<input type="button" value="Enviar" onclick = "check_txt(this.form)"> 
</form> 
</body> 
</html> 
__________________
¿Te apasiona el mundo del guión? El portal del guión