Possible Duplicate:
Validate a field depending on another field value in Symfony
How can I unset, ie, some form fields named A e B when a radio button R is checked?
I’d want to normally configure validators to these A/B fields but skip the check of their validators (and unset their value) if the radio button R is checked (eg, set A and B as strings required but validate them when R is checked even if they are empty).
I tried to override doBind function, use pre/post validator but I continue to receive ‘required’ message
Thanks!
It’s a correct operation. I found a couple of answers and the best place to do that is to override the
bindfunction and redefine validator’s options depending on values from the form (to disabled required option or remove the validator) :