[Php-avanzado] Validar cliente + servidor
Leandro Schereik
lschereik en hotmail.com
Mar Ago 3 01:15:07 ART 2010
Hola a todos, tengo dudas sobre validacion cliente servidor.
En el codigo de abajo tengo una validacion sencilla de un campo no vacio pero en mi codigo es solo del lado del cliente.¿ Como podria hacer para que sea una validacion cliente + servidor?
Muchas gracias
Leandro
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Validar </title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<script type="text/javascript">
function validar(){
if (document.getElementById("nom").value==""){
alert("Debe ingresar datos");
return(0);
}
document.getElementById("f").submit();
}
</script>
<body>
<form action="" name="f" id="f" method="post">
<input type="text" name="nom" id="nom">
<input type="button" name="ok" id="ok" value="si" onClick="javascript:validar()">
</form>
</body>
</html>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://www3.fi.mdp.edu.ar/pipermail/php-avanzado/attachments/20100803/07e9d024/attachment.htm
Más información sobre la lista de distribución Php-avanzado