![]() |
![]() ![]() |
![]() |
![]()
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 |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 4 298 Pomógł: 447 Dołączył: 16.11.2006 Ostrzeżenie: (0%) ![]() ![]() |
Wstaw kod w odpowiednie znaczniki i pokaż jakąś wersje live. W regex powinien być [a-zA-Z0-9]+ a ilość znaków sprawdzasz przy pomocy length.
-------------------- Nie udzielam pomocy poprzez PW i nie mam GG.
Niektóre języki programowania, na przykład C# są znane z niezwykłej przenośności (kompatybilność ze wszystkimi wersjami Visty jest wiele warta). |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 8.07.2025 - 04:35 |