Código HTML:
<html> <HEAD> </HEAD> <body> <script> function encripta(f) { document.write("encripta2"); document.write(f.userr.value); } </script> <form action="../index.php" method="post" id="formvalidador"> Usuario: <input type="text" name="userr" id="userr" size="20" tabindex="1"> Password: <input type="password" name="pass" id="pass" size="20" tabindex="2"> <input onclick="javascript:encripta(this.form);" type="submit" value="validar datos" name="validardatos" tabindex="3"> <input type="reset" value="borrar datos" name="borrar datos" tabindex="4"> </form> </body> </html>