I need to validate form using Jquery, below is my sample code
<input type="checkbox" name="field_1" />
<input type="checkbox" name="field_2" />
In the above two field any one field is required,I know this would be achieve by using radio button,for some reason I am using checkbox,I am trying below validation code,but I validate both fields
$('#myForm').validate({
rules: {
field_1: {
required: true,
number: true
},
field_2: {
required: true,
number: true
}
}
});
Any help is appreciated...
field_1&field_2or can able to change this to the same name asfield?