I have a form with a list of services on it. When the user submits the
form, I want it to remember what item on the list was selected. Even
if it's several page requests later.

I'm storing the index in session and trying to apply it to the form
field. Sending it in the constructor is probably tidier anyway, so I'm
changing it to do that.

But for future reference, you are saying $form->setDefault('field',
'value'); will work even after it's constructed and configure() has
been called?

On Apr 22, 10:38 am, Bernhard Schussek <bschus...@gmail.com> wrote:
> Hi Mark,
>
> On Wed, Apr 22, 2009 at 10:23 AM, Mark Smith
>
> <marksmith5...@jungle-monkey.com> wrote:
> > So you are saying the only way to change a form field once the object
> > exists, is to completely rebuild the form?
>
> No. The question is _when_ you want to change the form. You can change
> the default values any time in the object lifecycle before you render
> the form. Note that the default values are not displayed anymore once
> you call ->bind().
>
> If you need more help, please provide a little more information on
> what you are trying to achieve. Otherwise it's hard to give you
> specific advice.
>
> Bernhard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to