ciao a tutti
ho creato una paginetta di registrazione utente.
vorrei controllare i campi del form di registrazione tramite js.
ho creato un file "register.js" con la funzione regInit che dovrebbe fare i vari controlli.
il problema è che sembra non tenti nemmeno di entrare nella funzione quando faccio il submit del form.
ho messo un alert all'inizio della funzione e questo non mi compare...
vi mostro il codice html della pagina
codice:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" >
<head>
<title>Registrazione</title>
<script type="text/javascript" src="md5.js"></script>
<script type="text/javascript" src="register.js"></script>
<style type="text/css">
#uname, #upass, #logbtn, #upassc, #umail {
font-family: Verdana, Helvetica, sans-serif;
font-size: 8pt;
border: 1px solid #E5E5E5;
}
#logbtn {
width: 50px;
}
</style>
</head>
<body>
<div>
<form method="post" action="register.php"
onsubmit="return regInit('uname', 'upass', 'upassc', 'umail', 'logbtn');">
<TABLE id="register">
<TR><TD><LABEL for="uname">login</LABEL>
</TD><TD><input id="uname" name="user" type="text" />
</TD></TR>
<TR><TD><LABEL for="upass">password</LABEL>
</TD><TD><input id="upass" name="pass" type="text" />
</TD></TR>
<TR><TD><LABEL for="upassc">Conferma password</LABEL>
</TD><TD><input id="upassc" name="passc" type="text" />
</TD></TR>
<TR><TD><LABEL for="umail">email</LABEL>
</TD><TD><input id="umail" name="email" type="text" />
</TD></TR>
<TR><TD colspan=2 align="center"><input id="logbtn" type="submit" value="register" />
</TD></TR>
</TABLE>
</form>
</div>
</body>
</html>
la funzione regInit inizia cosi
codice:
// funzione per gestire il submit di registrazione
function regInit(user, pass, passc, email, button) {
alert('sono dentro');
.
.
.
}
cosa sbaglio?
grazie