I have a dynamic form that is generating a country list. My problem is that the second child option has a blank value and if selected invalidates the form.
<option value="">Not Applicable</option>
I have tried adding a custom method to identify and bypass this, but have been unable to bypass this senario.
$.validator.addMethod('state', function (value, element) {
var steText = $('#'+element.id+' option:selected').text();
if (steText == 'Not Applicable') {
return true;
} // <--
}, '');
here is the code for checking value
checking text
it will invalidates form if the option value is empty.