Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Moja Walidacja hasla
kenny1987
post 15.05.2012, 11:13:08
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 26.03.2012

Ostrzeżenie: (0%)
-----


Witam napisalem skrypt walidacji i nie dokonca wszystkie funkcje dzialaja

//Walidacja hasla
function blurenterpassword() {
var element = document.getElementById("enterpassword");
var wyrazenie = new RegExp([a-zA-Z0-9]);
if (element.value == ""){
document.getElementById("err_enterpassword").firstChild.nodeValue = "Pole Wymagane";
if (!element.value.match(wyrazenie) == NULL) {
document.getElementById("err_enterpassword").firstChild.nodeValue = "niepoprawny format hasla";
}
return false;
} else {
document.getElementById("err_enterpassword").firstChild.nodeValue = " ";
return true;
}
}
// Walidacja powtorzenia hasla
function blurretypepassword() {
var element = document.getElementById("retypepassword");
var haslo = document.getElementById("enterpassword");

if (element.value == ""){
document.getElementById("err_retypepassword").firstChild.nodeValue = "Pole Wymagane";
return false;
} else {
if(haslo.value != element.value ){
document.getElementById("err_retypepassword").firstChild.nodeValue = "Niepoprawne hasło";
return false;

} else {
document.getElementById("err_retypepassword").firstChild.nodeValue = " ";
return true;
}

}

}


Wyrazenie regularne nie dziala oraz chcialbym dopisac dlugosc hasla na min 6 znakow
Go to the top of the page
+Quote Post

Posty w temacie
- kenny1987   Moja Walidacja hasla   15.05.2012, 11:13:08
- - !*!   Wstaw kod w odpowiednie znaczniki i pokaż jakąś we...   15.05.2012, 12:38:19


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 12:26