You can create a simple rule by doing something like this:
And then applying this like so:
Just change the contents of the 'addMethod' to validate your checkboxes. | |||||||||
|
2
|
Thanks, it worked! Here's the final code:
| ||
|
0
|
Hi edward, I need this functionality as well, but my code isn't executing... Can you post a more complete example of you code? I don't know where to write the $.validator.addMethod, should that be outside of the form.validate code? I currently have: jQuery.validator.addMethod("at_least_one_cat_selected", function(value, element) { var the_list_array = $("ul#list_all_categories li input:checked"); return the_list_array.length > 0; }, "Please specify the correct domain for your documents"); and then inside the validation call: rules: { list_all_categories: {at_least_one_cat_selected: true} }, but that isn't working. Please note: list_all_categories is the name of the that contains all checkboxes? | ||
|
0
|
| ||
|
0
|
#PHP Returns JSON return ($m == $m) ? false : 'Email Already Registered' |