You can do two things:
The first one and the one CMANJS is recommending is to empty both password
fields in case validation fields (you can either unset the values in the
controller or make sure the input's 'value' attrib is set to "" in the
view). This is the one I'd recommend as well.

For controller unsetting, you can add this after validation fails:
*unset($this->data['User']['password']);*
*unset($this->data['User']['confirm_password']);*

Second one is to save the orginial unhashed password and then use it when
validation fails to fill the password inputs...

2009/7/14 CMNAJS <cmn...@gmail.com>

>
> hey i think its a good practice to empty both passwords and let the
> user re-enter his password. this is some sort of critical information
> and user must be sure what he has entered.
> up to you..
> but if you want to preserve... firstly decide what you want to
> preserve the password or confirm password.
> in case of preserving password you should change the name of the field
> of password to some password1 so that it is not automatically hashed
> and you can hash it when need to save after validation.
>
> On Jul 14, 8:31 am, "Dave Maharaj :: WidePixels.com"
> <d...@widepixels.com> wrote:
> > I have the confirm password working now, but if another field fails
> > validation the passwords entered becomes ●●●●●●●●●●●●●●●●●
> > ●●●●●●●●●●●●●●●●●●●●●●● in both password and confirm
> > , meaning the user now has to re-enter the password even if there was no
> > problem with the confirmation between the 2.
> >
> > I can set the fields to be empty if validation fails anywhere, but still
> > leaves the user entering them over again, which is not ideal
> >
> > How an it be set so they remain what the user typed?
> >
> > Thanks,
> >
> > Dave
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to