Hi now I search several hours for a solution. I have 20 fields (dropdowns) with the answers "yes" and "no". Now I want to validate, that the user must say to 3 of the 20 "yes". Which this are from the 20 does not matter.
For example one of the 20 dropdowns...
<select name="dd1" id="dd1">
<option value="yes">Yes</option>
<option value="no" selected="selected">No</option>
</select>
Does anyone have an idea for a solution?
For Validation I use for example this format:
$(document).ready(function(){
$("#register").validate({
rules: {
surname: {
required: true,
minlength: 3
},
messages: {
surname: {
required: "xxx",
minlength: "xxx"
},
errorPlacement: function (error, element) {
if ( element.is(":checkbox") )
error.appendTo(element.parent("td").next("td"));
else if ( element.is(":radio") )
error.appendTo(element.parent("td").next("td"));
else
error.appendTo( element.parent());
}
});
});