Description
Hi!
I have 2 form settings for Canada and US addresses, they are identical except of State/Province enumeration. Both forms are connected to same model object. When user switches country, specific form is shown. When I launch validation with default country, it works fine. But if I select another country, so new settings loaded and new form elements added -- it breaks validation because somehow validation goes through all form fields(CA and US have different enumerations for their states/provinces, so value will be invalid for one of them), for both countries even if they its not visible and should not be validated at all. This is confusing because selected country fiends show all fields valid but in total validation fails and "invalid" fields are being nullified with validator.
For now I found 2 solutions
- make own validation cycle asking each field is it valid
- change validation event handler in a way that will prevent inactive form fields to be validated.