Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 15th, 2007, 02:35 PM
Mitesh
Guest
 
Posts: n/a
Default Getting selected values in multi select comobo box through PHP

Hi,

I have the following HTML code right now.


Code:
-------------------------------------------------------------------------------------------------------------------------
<td width="20%"><SELECT NAME="cfg_input_global_report_types" MULTIPLE >
<OPTION VALUE="BU" >Option1
<OPTION VALUE="BP" >Option2
<OPTION VALUE="BC" >Option3
<OPTION VALUE="BL" >Option4
<OPTION VALUE="BCC">Option5
</SELECT></td>
-------------------------------------------------------------------------------------------------------------------------
The form is submitted using POST method

I know how to use the $_POST php function to get the
"cfg_input_global_report_types" variable

$_POST["cfg_input_global_report_types"]

But I don't know how the selected variables are formatted in the
$_POST["cfg_input_global_report_types"] variable. If anybody could show
me how the selected values are formated in the above variable it would
be great.

Or if this method doesn't work at all or if there is a more easy way,
how can I get the selected values in my multiple select combo box.

Thanx in advance.

  #2  
Old January 15th, 2007, 03:15 PM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: Getting selected values in multi select comobo box through PHP

Mitesh wrote:
Quote:
Hi,
>
I have the following HTML code right now.
>
>
Code:
-------------------------------------------------------------------------------------------------------------------------
<td width="20%"><SELECT NAME="cfg_input_global_report_types" MULTIPLE >
<OPTION VALUE="BU" >Option1
<OPTION VALUE="BP" >Option2
<OPTION VALUE="BC" >Option3
<OPTION VALUE="BL" >Option4
<OPTION VALUE="BCC">Option5
</SELECT></td>
-------------------------------------------------------------------------------------------------------------------------
The form is submitted using POST method
>
I know how to use the $_POST php function to get the
"cfg_input_global_report_types" variable
>
$_POST["cfg_input_global_report_types"]
>
But I don't know how the selected variables are formatted in the
$_POST["cfg_input_global_report_types"] variable. If anybody could show
me how the selected values are formated in the above variable it would
be great.
>
Or if this method doesn't work at all or if there is a more easy way,
how can I get the selected values in my multiple select combo box.
>
Thanx in advance.
>
Close. You need to use:

<SELECT NAME="cfg_input_global_report_types[]" MULTIPLE >

Note the "[]" following the name. You then will get the selections in
an array.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles