-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Validator not working with hidden forms #317
Comments
Known issue I think. Same here. |
Similar issue here: Got a div (with a form inside) that has collapse class. Doing the same thing without having collapse class (so div AND form are visible) Any workarounds of fixes are welcome. :) |
Found the solution, fixed it and Raised a PR for the same. |
By default, hidden input fields are not validated. With the release of 0.10.0, the input fields that get validated are cached for performance reasons, meaning that when a field becomes visible it still won't get validated. In the next version, the caching will become opt-in. You can work around your issue by initializing the validator on the tab shown event, or putting |
I have tried your solution posted and it worked, thank you 1000hz! |
I have two tabs ( A & B) and two forms (FormA & FormB) and I toggle the visibility of my forms on click of every individual tab. The form(FormA) that is shown in page load works fine but when I click on another tab the submit button is enabled for FormB even when the required values are not filled.
If I remove the hide class and show both the forms at page load the submit button is disabled and works as expected. If I switch the views FormB on page load then Form B works and FormA doesn't work.
I tried to look at the issues but couldn't find similar issue. Please suggest if this is a known issue or this will be taken care of in future releases.
Added jsbin replicating the issue
http://jsbin.com/yijatap/edit?html,console,output
Thanks,
Vatsal Pande
The text was updated successfully, but these errors were encountered: