1) my checkbox name is in the form of array "group[]", Basic checkbox validation is already done like this, its working
$.validator.addMethod('require-one', function(value) {
return $('.require-one:checked').size() > 0;
}, 'Please check at least one box.');
2) Below foreach statement is returning is retrieving four checkboxes from the database like email,phone,panno,socialnetworkurl checkboxes.
3) Now jquery validation is done with checkbox combination. for eg : if email,panno combination is already there in database if user selects that combination again is should show already that combination is present in database pls try another combiation. 4) i tried like this but not entering into group_check() in the controller
group: {
remote: "<?php echo base_url(); ?>settings/group_check"
},
My jquery validation is like this
<script>
jQuery(function() {
$("#regform").validate({
rules: {
color: {
required: true,
remote: "<?php echo base_url(); ?>settings/colorname_check"
},
group: {
remote: "<?php echo base_url(); ?>settings/group_check"
},
},
messages: {
color: {
required: "The Color field is required.",
remote: "This color already exists. Please choose another Color."
},
group:
{
remote: "This Group Name already exists. Please choose another Name."
},
messages: {
checkbox: "Please check at least one.",
}
},
onfocusout: false,
onkeyup: false,
onclick: false
});
});
</script>
My checkbox code is like this,
<?php
foreach ($groups as $group) {
?>
<tr class="s-usebrd" height="42">
<td align="right"><?php echo $group->name;?> <span for="group[]" generated="true" class="singleRowError" style="margin-left:6px;font-size:12px;color:red;"></span>
</td>
<td width="200px" style="padding-right: 10px">
<input type="checkbox" name="group[]" class="require-one" value="<?php echo $group->id; ?>" >
</td>
<td>
</td>
</tr>
<?php }?>
IF it atleast enters into codeigniter function remaining thing i can take care of this.Pls help me with this !!!!!!!!!!!!!!!!!!!