By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,215 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,215 IT Pros & Developers. It's quick & easy.

SelectBox and PHP

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
????

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

P: n/a
> > >$_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

P: n/a

"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.