View Full Version : Check boxes and radio buttons

01-06-2009, 08:57 PM
Hi All,

I am having some issues with checkboxes and radio buttons as the title suggests.

Here is the entire form....

<form method="POST">
<input name="flag" type="hidden" value="1" />
<p><input name="name" type="text" id="name" value="{$_POST['name']}" />*Name</p>
<p><input name="address" type="text" id="address" value="{$_POST['address']}" />*Address</p>
<p><input name="postal" type="text" id="postal" value="{$_POST['postal']}" />*Postal Code</p>
<p><input name="delivery" type="text" id="delivery" value="{$_POST['delivery']}" />*Date of Delivery</p>

<p>What is your concern about? </p>
<p><input name="concern[]" type="checkbox" value="{$_POST['nondelivery']}" />Non-Delivery<br/>
<input name="concern[]" type="checkbox" value="{$_POST['latedelivery']}" />Late Delivery<br/>
<input name="concern[]" type="checkbox" value="{$_POST['notusingmailbox']}" />Not using Mailbox<br/>
<input name="concern[]" type="checkbox" value="{$_POST['other']}" />Other Please Specify<input name="other" type="text" value="{$_POST['other']}" /></p>


<p><textarea name="message" cols="40" rows="4">{$_POST['message']}</textarea></p>

<p>Would you like a representative to contact you?</p>
<p><input type="radio" name="contact" value="{$_POST['yes']}" id="contact_0" />yes</p>
<p><input type="radio" name="contact" value="{$_POST['no']}" id="contact_1" />no</p>

<p><input type="text" name="email" value="{$_POST['email']}" />*Email Address</p>
<p><input name="phone" type="text" id="location" value="{$_POST['phone']}" />*Phone Number</p>

<p><img src="securimage_show.php"></p>
<p><input type="text" name="imagetext" /></p>

<p>For security reasons, please enter the text above<br>All fields are required</p>

<p><input type="image" name="submit" img src="images/submit.jpg" value="Send Form" /></p>


and here is the processing portion...

@mail("$to,$email", "Resident Services Form Completion from : " . $_POST['name'],
"Received from " . $_POST['name'] . " \n
Address : ". $_POST['address'] . "
Postal Code : ". $_POST['postal'] . "
Your Concern:
Non-Delivery : ". $_POST['concern'] . "
Late Delivery : ". $_POST['concern'] . "
Not using Mailbox : ". $_POST['concern'] . "
Other : ". $_POST['other'] . "
Please Specify : ". $_POST['otherdesc'] . "
Phone Number : ". $_POST['phone'] . "
Representative Should Contact: ". $_POST['contact'] . "
Message : " . $_POST[message]
, "From: " . $_POST['email']);

The issue is that i cannot seem to post the info from either...

here is a sample email i get back...

Received from 1

Address : 2
Postal Code : 3
Your Concern:
Non-Delivery : Array
Late Delivery : Array
Not using Mailbox : Array
Other :
Please Specify : 5
Phone Number : 911
Representative Should Contact:
Message : 6

As you can see I get array for the checkboxes and nothing for the radio buttons.


01-07-2009, 12:00 AM
I might be missing the point hers but the values ie
$_POST['nondelivery'] shoukldnt that just be value nondelivery?

if it is a validation form ,collecting from a previous form then i would try echo the value first

01-09-2009, 04:21 PM
no it is simply a contact form with captcha and some checkboxes...

Just cannot figure this one out though

01-12-2009, 07:29 PM
if u take away the value="" from the both radio buttons, than select one of the radio buttons and submit, than do u get anything in the email?
meaning is there any value in the post?

01-12-2009, 11:36 PM
i think as it is showing array ityt is posting but worth step by step checking anyway.
you have concern{} so it will interperate as a n array. i would have tried this by echoing the value in the form as its value ie value="<php echo blah blah?>"