Home > Article > Web Front-end > jQuery Validate cannot verify the chosen-select element. How to solve it
This article mainly introduces the solution to the problem that jQuery Validate cannot verify the chosen-select element. Friends who need it can refer to it. I hope it can help everyone.
After the choosen-select element executes the choose() method, it adds style="display: none;" to the select element to hide it, and then reconstructs a drop-down list that looks like select.
And jQuery Validate ignores verification of hidden elements by default, so we need to exclude select. Add the ignore attribute to the parameters of the validate() method to remove the select from the ignored hidden elements.
$("select").validate({ignore: ":hidden:not(select)"});
:hidden selector selects hidden elements. Elements in the following situations are hidden elements:
Set to display:none
Chosen jquery-based selection box plug-in usage method_jquery
##Jquery choosen dynamic setting value example introduction_jquery jquery select plug-in asynchronous real-time search implementation methodThe above is the detailed content of jQuery Validate cannot verify the chosen-select element. How to solve it. For more information, please follow other related articles on the PHP Chinese website!