Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/02/2010, 08:04
Death_Empire
 
Fecha de Ingreso: febrero-2010
Mensajes: 818
Antigüedad: 14 años, 2 meses
Puntos: 55
Respuesta: Orden en que ocurre la validación?

en el script te falta una llave de cierre.

prueba como te digo yo algo asi
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Adicionar nuevo cliente</title>
<link href="css/forms.css" rel="stylesheet" type="text/css" />


<script>
function valida_envia(){
//valido que solamente se escriban números en este control
co_id = document.datos.co_id.value
co_id = validarEntero(co_id)
document.datos.co_id.value=co_id
if (co_id==""){
alert("Solamente se admiten números.")
document.datos.co_id.focus()
return 0;
}
else
	document.datos.submit('pagina.php');
	
}
</script>



</head>
<body>
<div id="nifty">
<!-- el formulario -->
<form name="datos" action ="add_datos.php" method = "post" class="formLogin">
<fieldset>
<label>Código:</label>
<input id="empresa" type="text" name="co_id" size="6" title="Código de la Empresa"/>
<input type="button" name="boton" value="Enviar" onclick="return valida_envia()" />
</fieldset></form>
</div></body></html>