Ciao
Questo script mi serve per validare un campo testo. Come faccio a fagli verificare se i caratteri immessi siano numerici? sò che c'è la funzione "isNan", ma non riesco ad usarla.
function control(form) {
Ctrl = form.Password;
if (Ctrl.value == "") {
validatePrompt (Ctrl, "Inserire la password.");
return false;
}
Ctrl = form.Password;
if (Ctrl.value.length != 5) {
validatePrompt (Ctrl, "La password deve essere di 5 numeri.");
return false;
}
return true;
}
function validatePrompt (Ctrl, PromptStr) {
alert (PromptStr)
return false;
}

Rispondi quotando