On the registration page when the validations for profile fields fail, the page is refreshed with error messages. The problem is that then the password form is cleared even if the user has already entered an acceptable password. Is there any way to keep the password populated even if the page is refreshed after the validation fails?
2 Answers
The password form field is always cleared out when re-submitting the form after a validation handler reports an error.
There isn't a workaround to that, as the password form field is not using the "#default_value" property that usually other fields would use to pre-populate the fields with a value that is then edited from users. If you use the "#value" (supposing that would have any effect for the password form field) then that value would override the value entered from the users.
-
I always assumed that websites don't echo back the password due to security concerns. If you echo it back it might get stored in the browser cache.– uweCommented Jan 11, 2012 at 18:50
-
Ok thanks I understand.I thought it was a kinda bad usability especially when there are several validated fields that users often likely fail to pass on the first submission just like my site.– chinita7Commented Jan 12, 2012 at 2:59
I realise this post is old but I had a similar frustration. You can have the password fields not clear on validation by using client side validation.