Is there a way to validate individual fields in jQuery and not the whole form?

I have a form.

I applied tabs to it.

I have the following and previous tab navigation links.

I want to check some of the fields on tab 1 that have not been checked, does not allow the user to go to the next tab.

I work with only one form, divided between tabs.

The problem is that the jQuery validation plugin validates the form to submit.

I want to check out individual fields that click on the Next link.

Is there any way to do this?

+3
source share
1 answer

I just saw it in the validation documentation. I almost forgot about it. You do it with

$('#myform').validate().element('#myfield_in_myform');

hmm ...

+5

Source: https://habr.com/ru/post/1718862/


All Articles