Question

I have a editable dropdownlist like this one.

http://jqueryui.com/autocomplete/#combobox

It's hide a select and made a autocomplete textbox like this.

<select class="autocombobox" data-val="true" data-val-required="This field is required."
 id="F_FFormat" name="F.FFormat" style="display: none;">
<option value="">....</option>
......
</select>

When i remove style "display: none" it will validate correctly on client side. But if it still hidden then it will not be validated at all.

I do some googling and try this script

$.validator.setDefaults({ ignore: null });

but it not work either.

How can i fix this problem?

Thank you in advance.

Was it helpful?

Solution

Try this:

 var validator = $("#yourID").data('validator');    
 validator.settings.ignore = "";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top