Hi,

This is probably a basic question, and yet I can't seem to figure out the
best way to do this.

I have a registration form that has several fields, including 2 dependent
ones:
- Country
- State.

If Country == Canada, then I want the state field to have a drop down of all
provinces
If Country == US, then I want the state field to have a drop down of all
states
If Country == <anything else>, then I want the state field to be a text
field

I can figure out how to do it using jQuery (and use an onchange event on the
Country drop down), however, am not sure if there isn't a better solution. 
I know there is a DoctrineChain plugin, but my list of provinces/states is 
not coming from the database.

Additionally, I'm very stumped as to how to do validation for these fields.
If Country == Canada or US, then state is required.  If Country == <antyhgin
else> then state is optional.

I've considered using the PostValidator for the form, but am really not
quite sure how to do this properly.

Any advice or suggestions would be greatly appreciated.  I tried looking
through the manuals, but haven't found anything that has helped point me in
the right direction.

Thanks!

Eric




-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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