So basically I have a simple POST form that is being validated using Validate library from jquery, and it all works fine, but then I used the tabs function from bootstrap and many other libraries to separate the form into two different tabs. The problem now is that validation happens only to the open (visible) tab, regardless the condition of the other input fields in hidden tabs. Any possible suggestions?
I think your trouble might be that jquery by default will only validate visible fields. So what you need to do is tell jquery to not ignore your hidden fields (other tabs). This can be done as follows:
$("#form1").validate({
ignore: ""
});
By default ignore: ":hidden"
.
See this answer, and this documentation (Options -> Ignore).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With