Re: form post question
| From: | Floyd Resler | Date: | Thu, 28 Oct 2010 14:36:14 +0000 |
| Subject: | Re: form post question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309133@lists.php.net to get a copy of this message | ||
On Oct 28, 2010, at 10:12 AM, Jack wrote:
> I have a form which has the following: ( quick clip )
>
>
>
> <form id="form1" name="form1" method="post"
>
> action="http://www.abc.com/processing/process_form.php"
> onSubmit="return
> preSubmit();">
>
>
>
> <label>
>
> <input name="area_interest" type="checkbox"
> id="field13"
> value="Peer Guide" />
>
> Peer Guide</label>
>
> <br />
>
> <label>
>
> <input type="submit" value="Submit" />
>
>
>
> When the form runs process_form.php it emails the content and has several
> other fields from the form, but I have some fields like the one above that
> don't show up in the result. The script that builds the message looks like
> the below
>
>
>
> $temp_message .= "Area(s) of Interest: ".
> $_POST['area_interest'] ."\n";
>
>
>
> Is there anything obvious that I am missing?
>
>
>
> Is there a way for me to show all the fields from the form, and their field
> names which are received by process_form?
>
>
>
>
>
> Thanks!
>
> Jack
If it's a single checkbox and it's not not checked, nothing will come through. However,
if it is a series of checkbox with the same name then you will need to do this:
<input name="area_interest[]" type="checkbox" id="field13"
value="Peer Guide" />
Notice I changed area_interest to area_interest[]. This way any checkboxes that are checked will be
passed as an array.
Take care,
Floyd