$(document).ready( function() {
$("#myForm").validate({
rules : {
'otherField: { digits: true, min: 1 },
'checkBoxFields':{
required : {
depends: function(element) {
return $("#aChckBoxField:not(':checked')")
}
}
}
},
errorContainer: $("#warning, #summary"),
errorPlacement: function(error, element) {
//error.appendTo( element.parent("div").next("div") )
error.insertBefore("#checkBoxFields")
},
debug:true,
messages : {
otherFields: { digits: 'must be an integer', min: 'must be greater than 0' },
checkboxFields: "Select at least one box, please."
}
});
});
I have this button, that relates to the checkboxes:
<input type="submit" name="submit" value="Update" /> //<-- this used to contain the onclick event for the previous js validation function
This is the other button (not involved in any of the functionality above, it just launches a diff page):
<input type="button" value="Show page" onclick="window.location='somepage.do'"/>
I've added jquery's submit handlers but so far with the same result. Please help.

New Topic/Question
This topic is locked



MultiQuote


|