Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/07/2006, 18:45
heba80
 
Fecha de Ingreso: noviembre-2004
Mensajes: 496
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación Donde esta el error?

hola tengo un formulario q ingresa registros a una BD acabo de hacerle la validacion de campos
y el error q sale es q si no lleno un campo me sale la ventanita de advertencia "el campo es obligatorio" y al poner aceptar manda campo igual es decir lo manda vacio
<script language="javascript">
function validar()
{
patron=/^[0-9]*$/;
if (document.form1.banco.value == "") {
alert ("EL CAMPO BANCO ES OBLIGATORIO DEBE INGRESAR SU CLAVE PERSONAL");
document.form1.banco.focus();return;
}
if (document.form1.operacion.value == "") {
alert ("EL CAMPO OPERACION ES OBLIGATORIO DEBE INGRESAR EL SUYO");
document.form1.operacion.focus();return;
}
if (form1.nombre_re.value == "") {
alert ("EL CAMPO NOMBRE ES OBLIGATORIO DEBE INGRESAR EL SUYO");
document.form1.nombre_re.focus();return;
}
if (document.form1.apellidos_re.value == "") {
alert ("EL CAMPO APELLIDOS ES OBLIGATORIO DEBE INGRESAR SU EDAD ");
document.form1.form1.apellidos_re.focus();return;
}
if(isNaN(parseInt(document.form1.monto.value)) || patron.test(document.form1.monto.value)==0){
alert('EL CAMPO MONTO SOLO ACEPTA NUMEROS');
document.form1.monto.focus();return;
}
if(isNaN(parseInt(document.form1.telefono_re.value )) || patron.test(document.form1.telefono_re.value)==0){
alert('EL CAMPO TELEFONO SOLO ACEPTA NUMEROS');
document.form1.telefono_re.focus();return;
}
if (form1.mail_re.value == "") {
alert ("EL CAMPO MAIL ES OBLIGATORIO DEBE INGRESAR SU PAIS DE ORIGEN");
document.form1.mail_re.focus();return;
}
if (document.form1.mensaje_re.value == "") {
alert ("EL CAMPO MENSAJE ES OBLIGATORIO DEBE INGRESAR SU CIUDAD DE ORIGEN");
document.form1.mensaje_re.focus();return;
}
if (document.form1.nombre_be.value == "") {
alert ("EL CAMPO NOMBRE ES OBLIGATORIO DEBE INGRESAR SU CIUDAD DE ORIGEN");
document.form1.nombre_be.focus();return;
}
if (document.form1.apellido_be.value == "") {
alert ("EL CAMPO APELLIDOS ES OBLIGATORIO DEBE INGRESAR SU CIUDAD DE ORIGEN");
document.form1.apellido_be.focus();return;
}
if (document.form1.mail_be.value == "") {
alert ("EL CAMPO MAIL ES OBLIGATORIO DEBE INGRESAR ");
document.form1.mail_be.focus();return;
}
if (document.form1.direccion_be.value == "") {
alert ("EL CAMPO DIRECCION ES OBLIGATORIO DEBE INGRESAR ");
document.form1.direccion_be.focus();return;
}
if(isNaN(parseInt(document.form1.telefono_be.value )) || patron.test(document.form1.telefono_be.value)==0){
alert('EL CAMPO TELEFONO SOLO ACEPTA NUMEROS');
document.form1.telefono_be.focus();return;
}
document.form1.submit();
}
</script>
hay alguna forma de q salga solo la ventana de advertencia sin el boton de aceptar


este es el codigo del boton enviar
<td><input name="button" type="submit" class="Estilo3" onClick="validar()" value="Continuar"/></td>