I have to select boxes side by side in a form.
<select id="requestID">
...
</select>
OR
<select id="requestor">
...
</select>
I am using jquery and the jquery validate plugin. How can I make sure that the user selects value from only one of these select boxes?
I have tried the depends option, but that only gives you the ability to make at least one of the two 'selects' required.
I want to let the user choose atleast and only one of the select's values, user should not avoid both selects and should not choose both selects.
Any ideas please?
Right now this is where I stand,
rules : {
requestID: {
required: {
depends: function(element){
return !$("#requestor").val().length;
}
}
},
requestor: {
required: {
depends: function(element){
return !$("#requestID").val().length;
}
}
}
}