Quickform with javascritp md5 loop
| From: | Nicolas de Bari Embriz Garcia Rojas | Date: | Tue, 12 Sep 2006 05:03:45 +0000 |
| Subject: | Quickform with javascritp md5 loop | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-25102@lists.php.net to get a copy of this message | ||
I am implementing the javascript md5 (http://pajhome.org.uk/crypt/md5/) with html_quickform if works fine but i have a problem doing a registration form.
The form ask for fields like firstname, lastname, email. password and validate the input data but if for some reason the user submits the data and the validation do not pass, the password field is been hashed twice or more depending on how many errors/submits
I start and place the onsubmit element this way:
parent::HTML_QuickForm('signupForm','post','','','onsubmit="javascript:password1.value=hex_sha1(password1.value), password2.value=hex_sha1(password2.value)"');
if user for example types on the fist time password: aaa and then submit the form, the password field would be sha1(aaa) but if the validation form do not pass, if the user for example did not typed correctly the email, then after writing the email correctly and submitting the data again, password now will be sha1(sha1(aaa).
I would like to know if there is a way on html_quickform to not save or unset the password values on the form when it is not verified , so it does not metter how many errors the user can make, the password field all ways will be sha(foo) and not sha1(sha1(sha1(etc etc etc).
Regards.