Jump to content

Recommended Posts

guys,

I have looked on google for this and apparently noone is doing it.  I have 4 checkboxes and I want to send mail indicating which boxes were checked.  the only code I've found is PHP that captures the *status* of the boxes, such as "on" or "off".  I want to capture the names of the actual checkbox elements.  Here is the code I'm currently testing (which just prints out "on" or "off" to indicate which boxes are checked):

if(isset($_POST['checkboxes'])) {
	foreach($_POST['checkboxes'] as $selected){
		echo $selected . "</br>";
	}
} else {
    echo "No Desired Contact Time Specified.";
}

if I check all 4 boxes for instance, I get this:

on
on
on
on

any way to get the names?  thanks!

5 hours ago, ajetrumpet said:

Here is the code I'm currently testing (which just prints out "on" or "off" to indicate which boxes are checked):

I'm curious to know how that posted code outputs any settings with "off" (unchecked checkboxes aren't posted)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.