Ver Mensaje Individual
  #14 (permalink)  
Antiguo 13/04/2009, 11:08
Evidiel
 
Fecha de Ingreso: agosto-2002
Mensajes: 32
Antigüedad: 21 años, 7 meses
Puntos: 0
Respuesta: Como validar con botones tipo submit

y hasi no te funciona

<script type="text/javascript">
function validar(){
if (window.document.form1.SFPR.value==""){
alert('Debe llenar el campo sello y firma');
return false;
}else if (window.document.form1.ESCALA.value==""){
alert('Debe llenar el campo escala');
return false;
}else{
return true;
}
}
function validar2(){
if (window.document.form2.SFPR2.value==""){
alert('Debe llenar el campo sello y firma2');
return false;
}else if (window.document.form2.ESCALA2.value==""){
alert('Debe llenar el campo escala2');
return false;
}else{
return true;
}
}
</script>

<input type="button" name="nuevo_tipo" value="form1"
onClick="javascript: if (validar()) form1.submit();">

<input type="button" name="insertar" value="form2"
onClick="javascript: if (validar2()) form1.submit();">