Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using jQuery validation in my form http://jqueryvalidation.org/documentation/

I want to add the validation to all my fields but I want to ignore the hidden div's that have the class my_item.

So here is my jQuery:

 $("#myform").validate({ 
    ignore: ":hidden"
 });

How is it possible to exclude from this ignore case, the divs that have the class my_item. So something like $(":hidden").not(.my_item).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
378 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can use the :not() selector:

ignore: ":hidden:not(.my_item)"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...