I am having some trouble diplaying the values of my checkboxes in the email my form sends, I am using html form field that uses php and javascript Ajax to send the email. If I leave the code form Javascript out then all the values display as Yes and with the code it displays No. I'm new to php and would appreciate any help. Thanks.
HTML
<form method="post" action="test.php" name="contactform" id="contactform">
<input name="extension" type="checkbox" id="extension" value="extension">Extension<br>
<input name="wallmount" type="checkbox" id="wallmount" value="wallmount">Wall Mount<br>
<input name="deskmount" type="checkbox" id="deskmount" value="deskmount">Desk Mount
</form>
PHP
$extension=($_POST['extension'])?"Extension: Yes":"Extension: No";
$wallmount=($_POST['wallmount'])?"Wallmount: Yes":"Wallmount: No";
$wallmount=($_POST['wallmount'])?"Wallmount: Yes":"Wallmount: No";
$deskmount=($_POST['deskmount'])?"Deskmount: Yes":"Deskmount: No";
$msg.="$extension";;
$msg.="$wallmount";;
$msg.="$deskmount";;
Javascipt
jQuery(document).ready(function(){
$('#contactform').submit(function(){
var action = $(this).attr('action');
$('#contactform #submit').attr('disabled','disabled');
$("#message").slideUp(750,function() {
$('#message').hide();
$.post(action, {
extension: $('#extension').serialize(),
wallmount: $('#wallmount').serialize(),
deskmount: $('#deskmount').serialize(),
subject: $('#subject').val(),
verify: $('#verify').val()
},
function(data){
document.getElementById('message').innerHTML = data;
$('#message').slideDown('slow');
$('#contactform #submit').attr('disabled','');
if(data.match('success') != null) $('#contactform').slideUp('slow');
}
);
});
return false;
});
});