473,804 Members | 3,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting selected values in multi select comobo box through PHP

Hi,

I have the following HTML code right now.
Code:
-------------------------------------------------------------------------------------------------------------------------
<td width="20%"><SE LECT 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">Opt ion5
</SELECT></td>
-------------------------------------------------------------------------------------------------------------------------
The form is submitted using POST method

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

$_POST["cfg_input_glob al_report_types "]

But I don't know how the selected variables are formatted in the
$_POST["cfg_input_glob al_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.

Jan 15 '07 #1
1 9388
Mitesh wrote:
Hi,

I have the following HTML code right now.
Code:
-------------------------------------------------------------------------------------------------------------------------
<td width="20%"><SE LECT 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">Opt ion5
</SELECT></td>
-------------------------------------------------------------------------------------------------------------------------
The form is submitted using POST method

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

$_POST["cfg_input_glob al_report_types "]

But I don't know how the selected variables are formatted in the
$_POST["cfg_input_glob al_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.
js*******@attgl obal.net
=============== ===
Jan 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13656
by: Prashant | last post by:
Hi I have a problem with refreshing of Mviews , I will narrate every thing step by step: 1.create table a (a number); 2.insert into table a values(&a); (after inserting 2 rows and commiting) 3. create MATERIALIZED view b REFRESH WITH ROWID START WITH SYSDATE NEXT sysdate + 2/1440 as select * from a;
19
1865
by: harry | last post by:
Just want to traverse a listbox's (multi select) items & for those that are selected extract the displayed text - something like below - function getSelectedDescrs(lst) { var buf; var maxItems = lst.length; for (var i=0; i < maxItems; i++) {
1
5040
by: Alvey Sidecast | last post by:
This is probably embarrassingly simple, but I've been trawling through this ng for hours now and my brain hurts. I've got an unbound multi-column listbox (multi-select=none) whose rowsource is a query based on a combobox selection. After the selection is made from the combobox the listbox may, or may not, have records in it. If it doesn't, no problems, I've got; If Me.lbxContacts.ItemsSelected.Count = 0 Then
6
1426
by: Patrick Olurotimi Ige | last post by:
I would like to capture when a user has already selected an option from a multi select list / or Textbox So for example if a user selects a value 3 using a dropdown list or by inputing a value it shouldn't be allowed to select 3 again only values 2 and 1. using a rated 1 to 3 in order of preference) *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
0
1260
by: Mardy | last post by:
Hello I'm using a multi select listbox that allows the user to select one or more values that are stored in a database. The listbox values are generated from a lookup table (disciplines) and the associations (one-to-many) between the lookup table and the main table (requirements) are stored in a separate table. The listbox works fine and I am able to save multiple selections for new records. Turning now to the update process, I'd like...
6
22182
by: George | last post by:
Hi all, How can I get the value stored from the selected item and subitems of a listview? Thanks in advance, George
4
1715
by: Karen Hill | last post by:
I've got a list box that has two columns. I would like to get the value of the first column of the user selected row. How would I do that? It is not a multiselect listbox. PS Whats the difference between a "field list" and a "value list" in a combobox? Thanks in advance
3
8720
by: imrantbd | last post by:
I need array type name like "destList" must use for my destlist select box,not a single name.Or need a solution to capture multiple value of "destList" select box and send all selected value in php page.The multiple select value then insert in database added by comma.The following is my code: Form Page:form.php <head> <script language="JavaScript"> function addSrcToDestList() { destList1 = window.document.forms.destList; srcList...
11
5611
by: woodey2002 | last post by:
This problem is driving me crazy. Hello there, i am trying to create a search form for records in my access database. The search form will contain text boxes and a multi select list box. The user can enter their search criteria eg. surname, reg num, etc. in the text boxes. The multi select list box allows the user to select multiple counties which they have the option of including in the search. The user should be able to select or omit the...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.