473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

how to get multiple=multiple values from an optgroup ?

hey there all,

i have an html page that uses a select element with optgroups. I want
multiple="multiple"
but when i pass it to the php script, i do not know how to get the
values out.

like this

<select name="people" multiple="multiple" >

when this is submitted, are they passed as an array?

thanks

Oct 13 '06 #1
3 2820

"nephish" <ne*****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
hey there all,

i have an html page that uses a select element with optgroups. I want
multiple="multiple"
but when i pass it to the php script, i do not know how to get the
values out.

like this

<select name="people" multiple="multiple" >

when this is submitted, are they passed as an array?

thanks
make it name="people[]" then they will be..
Oct 13 '06 #2
On 13 Oct 2006 11:38:57 -0700, "nephish" <ne*****@gmail.comwrote:
>i have an html page that uses a select element with optgroups. I want
multiple="multiple"
but when i pass it to the php script, i do not know how to get the
values out.

like this

<select name="people" multiple="multiple" >

when this is submitted, are they passed as an array?
Change the name to "people[]" - this causes PHP to process it as an array.
Otherwise you only get one of the selected values.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 13 '06 #3
well cool.
Thought (hoped) it would be something that simple.

cheers guys, and thanks for the help

sk

On Oct 13, 4:12 pm, Andy Hassall <a...@andyh.co.ukwrote:
On 13 Oct 2006 11:38:57 -0700, "nephish" <neph...@gmail.comwrote:
i have an html page that uses a select element with optgroups. I want
multiple="multiple"
but when i pass it to the php script, i do not know how to get the
values out.
like this
<select name="people" multiple="multiple" >
when this is submitted, are they passed as an array? Change the name to "people[]" - this causes PHP to process it as an array.
Otherwise you only get one of the selected values.

--
Andy Hassall :: a...@andyh.co.uk ::http://www.andyh.co.ukhttp://www.and....co.uk/space:: disk and FTP usage analysis tool
Oct 13 '06 #4

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

Similar topics

66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
10
by: shank | last post by:
I have a recordset that contains multiple records of product a user is purchasing. For clarity, I converted the recordset fields to variables. I need to take that entire recordset and insert it...
1
by: John Smith | last post by:
I have a user assigned multiple roles and a role can be inherited from multiple parents (see below). How do I answer such questions as "How many roles does the user belongs to?" I answered the...
2
by: Nick | last post by:
Is it possible through css to make an element in a multiple list menu unselectable. Im organizing my list by using titles... +-------------+ | CATEGORY 1 | | option 1 | | option 2 | | ...
1
by: JS | last post by:
I have this form in test.jsp, that consists of 3 drop/down menus (sel1, sel2 and sel3): <body onload="createFirstMenu('sel1');"> <form name="sels" method="post" action=""> <select...
16
by: Nikolay Petrov | last post by:
How can I return multiple values from a custom function? TIA
10
by: ads | last post by:
hi, after binding the dropdownlist to a datasource, ive experience this error "Cannot have multiple items selected in a dropdownlist" after using the code:...
2
by: PW | last post by:
Is it possible to make a select list item red based on a condition ? TIA, PW
8
by: aleksandar.ristovski | last post by:
Hello all, I have been thinking about a possible extension to C/C++ syntax. The current syntax allows declaring a function that returns a value: int foo(); however, if I were to return...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.