JQuery Validate cannot verify the chosen-select Element Solution, jqueryselectchosen
After the chosen-select element executes the chosen () method, it adds style = "display: none;" to the select element to hide it, and re-constructs a drop-down list that looks like select.
By default, jQuery Validate ignores the verification of hidden elements. Therefore, select should be excluded. Add the ignore attribute to the parameters of the validate () method and remove select from the hidden elements ignored.
$ ("Select"). validate ({ignore: ": hidden: not (select )"});
: The hidden selector selects hidden elements. The elements in the following situations are hidden elements:
- Set to display: none
- Form element with type = "hidden"
- Set width and height to 0.
- Hidden parent element (this also hides child elements)
Note: This selector does not work for the visibility: Den den and opacity: 0 elements.
The above section describes how jQuery Validate cannot verify the chosen-select element. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!