I'm using Nice select which replaces the current <select> dropdown with a <ul> list which can be customized with the CSS.
I try to use the jQuery Validate plugin but I can't make it work with <ul> list. It work well if I deactivate 'Nice select plugin' and I keep the current <select> dropdown.
Concretely the form now looks like :
<form id="MyForm">
<div class="nice-select">
<ul class="list">
<li class="option selected" data-value=""></li>
<li class="option selected" data-value="51"></li>
<li class="option selected" data-value="52"></li>
<li class="option selected" data-value="53"></li>
</ul>
</div>
</form>
and the jQuery
$('#MyForm').validate({
rules: {
list: {
selectcheck: true
}
}
});
jQuery.validator.addMethod('selectcheck', function (value) {
return (value != '');
}, "field required");
});
(If you delete the line which call nice select to the bottom of the javascript textarea it'll work)
How can I implement the jQuery validate to work as well with nice select ?
Any help would be appreciated
Thanks