Is your field a 'select' type? How are you setting the default value? >From memory, using 'selected'=>'value' forces the input view to show initial 'value', but using 'default'=>'value' will only populate 'value' if data is not present for that field - so in the case of failed validation (where data is returned to the view) the user- entered value will stand.
On Jul 27, 11:54 pm, Shaun <[email protected]> wrote: > I have a form field named user_first_name with no default value. When > a user named Fred completes this field correctly, but enters invalid > data in another field such as user_password, user_first_name is > automatically repopulated with "Fred" so Fred doesn't need to write > his first name again. Nice! > > However, I also have a form field named user_birth_year with a default > value of "YYYY". Fred enters a valid birth year, but an invalid > password. Rather than saving his correct birth year, the field is > automatically repopulated with "YYYY". > > How can this be avoided? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
