Using this example from Validation Plug-in's 'required (dependency-expression)' explanation:
$("#myform").validate({
rules: {
details: {
required: "#other:checked"
}
}, debug:true
});
$("#other").click(function() {
$("#details").valid();
});
I'm trying to make the text input required if radio button #guide is selected in example below:
<input type="radio" id="outfitter" name="memtype" value="Outfitter" />Outfitter $125
<input type="radio" id="guide" name="memtype" value="Guide" />Guide $75
<input type="text" id="sponout" name="sponout" size="75" />
I just don't know where to place
$("#other").click(function() {
$("#details").valid();
});
within rules validation coding.