Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
82
rated 0 times [  88] [ 6]  / answers: 1 / hits: 5405  / 8 Years ago, tue, november 29, 2016, 12:00:00

I have a form that changes the inputs displayed on screen depending on a drop down list value.


This ignore definition works fine and does not validate any inputs with ignore class and that are not visible.



ignore: :not(:visible), .ignore,


But the problem now is when I want to validate a few hidden inputs with class 'validate' , so I changed this to:



ignore: :hidden:not(.validate), :not(:visible), .ignore,


But the :not(:visible) blocks it. How to apply these 2 rules together so I will be able to ignore not visible inputs and validate hidden inputs with 'validate' class?


More From » jquery

 Answers
6

If you want to ignore all hidden elements, but still validate any hidden element with the .validate class, it's simply the default :hidden selector with the .validate class excluded...



ignore: :hidden:not(.validate)


DEMO: jsfiddle.net/0avft8ou/



You probably don't need an .ignore class because the plugin will automatically ignore any hidden element.


[#24531] Sunday, November 27, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
patriciakiarrac

Total Points: 532
Total Questions: 100
Total Answers: 89

Location: Ivory Coast
Member since Sun, Mar 7, 2021
3 Years ago
;