Re: getting value from select-element
| From: | Pavel Jartsev | Date: | Thu, 19 Oct 2000 08:54:48 +0000 |
| Subject: | Re: getting value from select-element | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21125@lists.php.net to get a copy of this message | ||
Ohlson Stefan wrote:
>
> Hi! I have a select popup and on an onchange-event I send the selected value
> to a JS-function.
> That works alright with IE but not with Nescape.
> Anyone any ideas?
>
> .. skip ..
> <?
> print"<form action='script/enkel_sok.php3' method='GET'
> name='enkel'>";
> print"<select name='DB' size='1'
> onchange='valjdb(enkel.DB.value);'>";
Try this way:
... onChange='valjdb(enkel.DB[enkel.DB.selectedIndex].value);' ...
'enkel.DB.selectedIndex' is index of selected item of select-popup.
'enkel.DB[enkel.DB.selectedIndex].value' is the correct value you need.
Hope this helps.
:)
--
Pavel a.k.a. Papi