PDA

View Full Version : Require one of two form fields to be present



thorben
16 Nov 2011, 5:07 AM
I have a form containig two fieldsets with
checkboxToggle:true and want to force that at least one of the two fieldsets is checked.

Will I need to specify a validation rule on one of the fieldsets or is there a way to bind a validation rule to the form, not to a specific field?

I would like the message to be displayed not on one of the checkboxes, but somewhere "globally" on the form.

mitchellsimoens
16 Nov 2011, 1:15 PM
Using MVC?

thorben
21 Nov 2011, 1:26 AM
Currently not, but would that help? We could easily migrate the dialog so that it conforms to MVC... But I think loadRecord() doesn't do more than just setValues with rec.data, so is there any advantage in doing so, validation-wise?

tobiu
21 Nov 2011, 6:14 AM
form validation wise, i guess not.
the only point is, that you can additionally validate the model as well and can check the missing fieldset on that level.

in general, validating fieldsets (and validators for them) sounds like a good feature request. you know where the forum is :)