473,324 Members | 2,501 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,324 software developers and data experts.

SelectBox and PHP

Hy there...

I have the following:

<select name="options">
<option value="10">number10</options>
<option value="20">number20</options>
</select>

If I want to print the choice I would use $_POST{'options'} and the
$_POST{'options'} would have values of selected choice(10,20)

But how can I print the selected text,not value(number10,number20) or do I
have to use JS for that?

Thanx....

point
Jul 16 '05 #1
6 3307
Message-ID: <bj*********@enews3.newsguy.com> from point contained the
following:
If I want to print the choice I would use $_POST{'options'} and the
$_POST{'options'} would have values of selected choice(10,20)
Square braces I think.
But how can I print the selected text,not value(number10,number20) or do I
have to use JS for that?


http://uk.php.net/switch

--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 16 '05 #2
????

I don't get it.....

I know what is switch used for but I need text from select box not switching
values....

Could you be more specific what did you ment...

Respect...
"Geoff Berrow" <$b**@ckdog.co.uk> wrote in message
news:k5********************************@4ax.com...
Message-ID: <bj*********@enews3.newsguy.com> from point contained the
following:
If I want to print the choice I would use $_POST{'options'} and the
$_POST{'options'} would have values of selected choice(10,20)


Square braces I think.

But how can I print the selected text,not value(number10,number20) or do Ihave to use JS for that?


http://uk.php.net/switch

--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

Jul 16 '05 #3
> > >$_POST{'options'} would have values of selected choice(10,20)

Square braces I think.


That's my standard coding practice....works like this too....

respect....
Jul 16 '05 #4

"point" <po***@caanNOSPAMproduction.com> schreef in bericht
news:bj*********@enews3.newsguy.com...

But how can I print the selected text,not value(number10,number20) or do I
have to use JS for that?


Yes, as only the option's value will be submitted...

JW


Jul 16 '05 #5
Message-ID: <bj*********@enews3.newsguy.com> from point contained the
following:
I don't get it.....

I know what is switch used for but I need text from select box not switching
values....

But the script is not returning that text, only the values. However if you
code the options text in the switch statement ( or better yet assign the
text to separate variables and include those both in the switch statement
and the options box) then you can print the text depending on which value
is selected.

Hope that's clear.
--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 16 '05 #6
Thanks...

That's what I wanted to hear...

respect...

"Janwillem Borleffs" <jw*@jwbfoto.demon.nl> wrote in message
news:3f***********************@news.euronet.nl...

"point" <po***@caanNOSPAMproduction.com> schreef in bericht
news:bj*********@enews3.newsguy.com...

But how can I print the selected text,not value(number10,number20) or do I have to use JS for that?


Yes, as only the option's value will be submitted...

JW

Jul 16 '05 #7

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

Similar topics

2
by: Tole | last post by:
hi all, i've got a selcetbox (multiple) which is filled by javascript. only problem is that i have aprox 1000 options to add to that select, and that adding lasts for 5-6 seconds. Even...
6
by: Piotr Pietrowski | last post by:
Hello everybody, I have a *big* problem. I thought its not that big problem for you professionals... Anyway, I have a begin date which has 3 dropdown boxes (day/Month/Year). The same for the...
7
by: Erwin Moller | last post by:
Hi, situation: I have a long list of options in multiple selectbox. The selectbox gets a scrollbar in that situation. Does anybody know if it is possible to scroll through the options with...
3
by: Stefan Richter | last post by:
I would like to fill a Selectbox dynamically. I am taking all values from a db, and fill them into a selectbox. I guess the best way was to use some kind of a dynamical array, where you don't have...
4
by: shankwheat | last post by:
I'm passing a string like 'Div3,Div4' to use as options in a selectbox but I need the text the user sees in the box different from the values. My code populates the values in the selectbox...
4
by: evanburen | last post by:
I have a bi-dimensional array that looks like this. I could split this up any I need to if there is a better method. {1,COMS}{2,IBM}{3,F} I want to use this array to populate a selectbox. The...
1
by: mamidira | last post by:
I had 3 select boxes in my form where all the 3 are dependent on the above select box. i.e., the values in the second select box is dependent on the selection of the first selectbox and same with...
1
by: giloosh | last post by:
i would like to dynamically output such a selectbox below using php and mysql: <select> <option< 100 </option> <option100 to 150 </option> <option150 to 200 </option> <option200 to 250...
3
by: =?iso-8859-1?q?Jesper_R=F8nn-Jensen?= | last post by:
I'm working with a requirement to make a selectbox the same height as normal text input elements. (at least for IE7) But in IE the selectbox reacts strangely to the CSS rules. Normally, there...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.