I have a form with set of dropdown fields, each of which has a default value of "0" and available values of 1-3. These are serving as a priority selection, where the user picks their top 3 items. Each select field name is unique and populated in a PHP foreach loop -- I'm just calling it "N" in the example below.
<select class="variable_priority unique required" name="select-N">
<option value="0"></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
The "0" value is used as the default/preset value for non-prioritized selections. Using the techniques described here, I have successfully modified JQuery Validate to ensure that the user cannot pick 1, 2 or 3 in more than one dropdown by comparing the class "variable_priority":
$('.variable_priority').each(function () {
if ($(this).val() === value && $(this).val() > 0) {
timeRepeated++;
}
});
However, I still need to validate that the user has indeed entered a value of 1, 2 and 3 in any of the select fields, and has not skipped any. Can anyone give me some guidance on how to do this within the context of JQuery Validate?