Hi,
I have a input field where the user must enter a
required fixed value "yes" but only if a specific value is selected in another "select" element.
I know how to conditionally remove the "required" value but how to I remove the "equalTo" :
- $("#disclaimer").rules("add",
{
required:function (element) {
return $("#mySelect").val() != 1;
},
equalTo:function (element) {
if ($("#mySelect").val() != 1) {
return "#disclaimerAnswer";
} else { - // what am I supposed to return here ??
return undefined;
}
},
messages:{
required:"Required input",
equalTo:"Please enter 'yes'"
}
}
);
What am I suppose to return in the equalTo if I
do not require anything to be entered on the input ?
cheers