I have a form with the following checkbox:
<input type=“checkbox” name=“Invoice” value=“Yes” style=“position:relative; margin-top:13px;” />
Then using jquery for validation, and I dont think Im using the right way.
$('#submit').click(function () {
var hemail = $('input[name=Hemail]');
var hrooms = $('input[name=Hrooms]');
var invoice = $('checkbox[name=Invoice]');
var data = '&Hname=' + hname.val() + '&RazSoc=' + razsoc.val() + '&Cif=' + cif.val() + '&Cname=' + cname.val() + '&Phone=' + phone.val() + '&Address=' + address.val() + '&Address2=' + address2.val() + '&BAddress=' + baddress.val() + '&BAddress2=' + baddress2.val() + '&Countries=' + countries.val() + '&Hwebsite=' + hwebsite.val() + '&Hemail=' + hemail.val() + '&Hrooms=' + hrooms.val() + '&Invoice=' + invoice.val() + '&Name=' + name.val() + '&JTitle=' + jtitle.val() + '&Email=' + email.val() + '&Ctel=' + ctel.val();
}
The two examples above var invoice = $(‘checkbox[name=Invoice]’); are to show the other parts which are working fine, but I dont seem to be able to gather the value from the checkbox when its checked, so wondered what was the right way