I need to validate a field based on the value of a hidden field. I tried this custom rule:
jQuery.validator.addMethod("cityselected", function() {
if ($('#featureID').val() == "") return false;
else return true;
});
cityselect: {
required: true,
cityselected: true
},
featureID is a hidden input which I need to check has a value. This doesnt seem to work though. Any ideas?