|
|
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
|
|
0
|
|
|
|
Reply
|
point5404 (24)
|
9/2/2003 9:29:11 AM |
|
Message-ID: <bj1nqr01is9@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/
|
|
0
|
|
|
|
Reply
|
Geoff
|
9/2/2003 10:13:16 AM
|
|
????
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" <$bl$@ckdog.co.uk> wrote in message
news:k5r8lvs9lfohnq5ot5neobl6tvldqseb24@4ax.com...
> Message-ID: <bj1nqr01is9@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/
|
|
0
|
|
|
|
Reply
|
point5404 (24)
|
9/2/2003 12:16:57 PM
|
|
> > >$_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....
|
|
0
|
|
|
|
Reply
|
point5404 (24)
|
9/2/2003 12:19:24 PM
|
|
"point" <point@caanNOSPAMproduction.com> schreef in bericht
news:bj1nqr01is9@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
|
|
0
|
|
|
|
Reply
|
jwb289 (17)
|
9/2/2003 12:46:32 PM
|
|
Thanks...
That's what I wanted to hear...
respect...
"Janwillem Borleffs" <jwb@jwbfoto.demon.nl> wrote in message
news:3f549127$1$28907$1b62eedf@news.euronet.nl...
>
> "point" <point@caanNOSPAMproduction.com> schreef in bericht
> news:bj1nqr01is9@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
>
>
>
>
|
|
0
|
|
|
|
Reply
|
point5404 (24)
|
9/2/2003 12:57:58 PM
|
|
Message-ID: <bj21lh01t1k@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/
|
|
0
|
|
|
|
Reply
|
Geoff
|
9/2/2003 1:07:41 PM
|
|
|
6 Replies
39 Views
(page loaded in 0.143 seconds)
|
|
|
|
|
|
|
|
|