Array of Checkboxes Help!!!
Hi All,
Newbie here. Would appreciate if i can get some help here.
I have a array of check boxes declared as follows:
- <tr class="<?php echo "cls" . $status; ?>">
<td id="c"> <input type=checkbox id= "deleteConsignments1" name="deleteConsignments[]" onclick="row_color(this)" value= <?php echo $address2->getId(); ?> /> </td>
What i would like to acheive is that if that the form should only submit when only 1 of the checkboxes is checked. I have the following JQuery but it does'nt seem to work. Please help.
- $("#btnUseAddress").click(function(){
alert('asdf');
$("#form_action").val("show_invalid");
if ($('#deleteConsignments').is(':checked'))
{
alert("sdfsdf");
$("#bookingForm").submit();
}
});
I would appreciate all the help!!!!
Thanks.