![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 5 Pomógł: 0 Dołączył: 27.04.2011 Ostrzeżenie: (0%) ![]() ![]() |
Mam formularz do wypełnienie i chciałbym, żeby obok pola hasło był button generuj i po kliknięciu generowało by hasło do tego pola tekstowego. Mam już zrobione losowanie hasła, ale nie wiem jak zrobić ten button.
|
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 278 Pomógł: 35 Dołączył: 25.06.2010 Ostrzeżenie: (0%) ![]() ![]() |
Takie coś nie w pehapie, a javascripcie
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 1 012 Pomógł: 109 Dołączył: 26.09.2003 Skąd: nexis.pl Ostrzeżenie: (0%) ![]() ![]() |
Takie coś nie w pehapie, a javascripcie Zgadza się, stąd funkcja żywcem wzięta z phpMyAdmin: Kod /**
* Generate a new password and copy it to the password input areas * * @param object the form that holds the password fields * * @return boolean always true */ function suggestPassword(passwd_form) { // restrict the password to just letters and numbers to avoid problems: // "editors and viewers regard the password as multiple words and // things like double click no longer work" var pwchars = "abcdefhjmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWYXZ"; var passwordlength = 16; // do we want that to be dynamic? no, keep it simple :) var passwd = passwd_form.generated_pw; passwd.value = ''; for ( i = 0; i < passwordlength; i++ ) { passwd.value += pwchars.charAt( Math.floor( Math.random() * pwchars.length ) ) } passwd_form.text_pma_pw.value = passwd.value; passwd_form.text_pma_pw2.value = passwd.value; return true; } |
|
|
![]() ![]() |
![]() |
Aktualny czas: 12.10.2025 - 17:13 |