grazie
2 script x esempio
codice:
//FUNZIONE PER IL CONTROLLO DELLA PASSWORD
function checkPassword(whatYouTyped) {
var verifica_3 = false;
var fieldset = whatYouTyped.parentNode;
var txt = whatYouTyped.value;
if (txt.length > 7) {
fieldset.className = "welldone";
verifica_3 = true;
}
else {
fieldset.className = "kindagood";
}
return verifica_3;
}
//FUNZIONE PER IL CONTROLLO DELLA CONFERMA PASSWORD
function checkcPassword(whatYouTyped) {
var verifica_4 = false;
var conferma = document.modulo.conferma.value;
var password = document.modulo.password.value;
var fieldset = whatYouTyped.parentNode;
if (password == conferma) {
fieldset.className = "welldone";
verifica_4 = true;
}
else {
fieldset.className = "kindagood";
}
return verifica_4;
}
Parte html
codice:
<form method="post" action="..\php/registra.php" name="modulo">
<fieldset>
<label>Username</label>
<input type="text" name="username" id="username" onkeyup="checkUsernameForLength(this)" ;/>
</fieldset>
<fieldset>
<label>Password</label>
<input type="password" name="password" id="password" onkeyup="checkPassword(this)" ;/>
</fieldset>
<fieldset>
<label>Cognome</label>
<input type="text" name="cognome" id="cognome" onkeyup="checkNameForLength(this)" />
</fieldset>
<input type="submit" value="Registrati" name="conferma_reg" id="conferma_reg" class="button2" onclick="checkEnableSubmit" />
</form>