Ken Ken - 7 days ago 5
jQuery Question

jquery form Validate wouldn't work using tabs in page

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?

Answer

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).