View Full Version : Handling Checkboxes

02-20-2010, 02:25 AM
Ok, so I looked up this up a bunch of places, but none of them could really solve my issue, which is suprising, because it seems pretty simple...

I have a very basic ajax email form, and I just can't figure out how to handle the checkboxes in it. It would be great if I could have the email send the values of the checkboxes if they are checked (for example, if there were checkboxes 1,2, and 3, if only 3 were checked, the email would display "boxes checked: 3"), but if not, it's not a disaster to have each box even displaying a true or false value.

Here's my PHP, and here's and example (http://djjenius.com/testing/paplus/contact.html) of the page... I hope someone can help me with this?

//declare variables
$name = $_GET['name'];
$title = $_GET['title'];
$company = $_GET['company'];
$address1 = $_GET['address1'];
$address2 = $_GET['address2'];
$city = $_GET['city'];
$state = $_GET['state'];
$email = $_GET['email'];
$telephone = $_GET['telephone'];
$fax = $_GET['fax'];
$dial = $_GET['dial'];
$auto = $_GET['auto'];
$comptel = $_GET['comptel'];
$other = $_GET['other'];
$app=($_GET['a2'])?"Yes":" No";
$see = $_GET['purchase'];
$list = $_GET['MailingList'];
$subject = "Demo Request from Website!";
$message = " Contact Information: \r \n Name: $name \r \n Title: $title \r \n Company: $company \r \n Address: \r \n $address1 \r \n $address2 \r \n Location: $city , $state \r \n Email: $email \r \n Phone Number: $telephone \r \n Fax: $fax \r \n \r \n Interested in... \r \n Predictive Dialer? = $dial \r \n Auto Dialer? = $auto \r \n Computer Telephony? = $comptel \r \n Other: $other \r \n \r \n This person wants to see: \r \n Overall1: $overall1 \r \n Overall2: $overall2 \r \n App: $app \r \n This person needs a solution: $purchase \r \n \r \n Add to the mailing list? $mailinglist";

mail("escalantejeff@gmail.com", $subject, $message);


<h5><span>Thank You,<h10>&nbsp;<?php echo $name ?>!</h10></span></h5>
<p class="heading2"><span>Your message will be answered as soon as possible.</span></p>