Jquery Conditional validation based on select text
问题 I want to make the "other" field required ONLY if the selected text in the "select1" field is "other" the rule I'm trying is: other: { required: function(element){ return $("#select1 option:selected").text() == "Other"; } } Am i doing something wrong? Here's the code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http:/