ok disculpa
Código Javascript
:
Ver originalfunction validacion(){
valor = document.getElementById("nombre").value;
valor2 = document.getElementById("email").value;
valor3 = document.getElementById("email").value;
valor4 = document.getElementById("localidad").value;
valor5 = document.getElementById("depar").selectedIndex;
valor6 = document.getElementById("asunto").value;
valor7 = document.getElementById("texto").value;
if ( valor == null || valor.length == 0 || /^\s+$/.test(valor) ){
alert('Por favor, Escriba su Nombre');
nombre.focus();
return false;
}else
if ( valor2 == null || valor2.length == 0 || /^\s+$/.test(valor2)){
alert('Por favor, Escriba su Email');
email.focus();
return false;
}else
if ( !(/^[a-z0-9]+[a-z0-9\_\-\.]*[a-z0-9]+@{1}[a-z0-9]{2,128}\.([a-z0-9]{2,6}(\.[a-z0-9]{2,4})?)$/i.test(valor3))){
alert('Por favor, Escriba un Email correcto');
email.focus();
return false;
}else
if ( valor4 == null || valor4.length == 0 || /^\s+$/.test(valor4) ){
alert('Por favor, Escriba su Localidad');
localidad.focus();
return false;
}else
if ( valor5 == null || valor5 ==0){
alert('Por favor, Seleccione un Departamento');
depar.focus();
return false;
}else
if ( valor6 == null || valor6.length == 0 || /^\s+$/.test(valor6) ){
alert('Por favor, Escriba su Asunto');
asunto.focus();
return false;
}else
if ( valor7 == null || valor7.length == 0 || /^\s+$/.test(valor7) ){
alert('Por favor, Escriba su Mensaje');
return false;
}
return true;
}
Código HTML:
Ver original<form method="post" action="enviar.php" onsubmit="return validacion()" name="form" > <td><input type="submit" name="enviar" value="Enviar" style="padding:5px;" /></td>