I'm using jQuery tools validator for my web app in ASP.net MVC4. I'm trying to validate dropdownbox using validator without success.
I've gone through this question, but it dosen't solved my problem.
my code is as below.
$.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;
}
});
it does alerts all the alert but it dosen't show error message on false, rather on selecting element it does fires selected item's value as validation message.
any help would be appriciated.