<select id="select" class="required"> <option value="">Choose an option</option> <option value="option1">Option1</option> <option value="option2">Option2</option> <option value="option3">Option3</option> </select> $.validator.addMethod("valueNotEquals", function(value, element, arg){ return arg !== value; }, "Value must not equal arg."); $("form").validate({ rules: { SelectName: { valueNotEquals: "default" } }, messages: { SelectName: { valueNotEquals: "Please select an item!" } } });
Обсуждают сегодня