我使用jQuery tools验证器为我的web应用程序在ASP.net MVC4。 我想验证dropdownbox使用验证器没有成功。下拉框 - 需要验证使用jQuery.tools.validator
我已经通过了this的问题,但它并没有解决我的问题。
我的代码如下。
$.tools.validator.fn("select[required=required]", function(input, value) {
// If the first item in the list is selected return FALSE
alert("Inside required of dropdown");
if(input[0].options[0].selected)
{
alert("returning false");
en: "Please select value from this drop down"
}
else
{
alert("returning true");
return true;
}
});
它提醒所有的警报,但它这么想的虚假显示错误信息,而在选择元素它所选项目的值作为验证消息的火灾。
任何帮助将appriciated。