For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > March 2004 > select text from drop down menu









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author select text from drop down menu
R.G. Vervoort

2004-03-26, 11:13 pm

I would like to select the text from a selected item in a drop down menu.


I know how to select the option value (this will be my id wich i send with
PHP to a database) but i would also like to place the text from the option i
selected in a textbox with the onChange action.

this places the value in a textfield:

<select name="testmenu" onChange="textfield.value=testmenu.value;">

what can i do to place the items text in another textboix?



Roy


Netherlands




Justin Koivisto

2004-03-26, 11:13 pm

R.G. Vervoort wrote:
> I would like to select the text from a selected item in a drop down menu.
>
>
> I know how to select the option value (this will be my id wich i send with
> PHP to a database) but i would also like to place the text from the option i
> selected in a textbox with the onChange action.
>
> this places the value in a textfield:
>
> <select name="testmenu" onChange="textfield.value=testmenu.value;">


<select name="testmenu"
onChange="textfield.value=this.options[selectedIndex].text;">

--
Justin Koivisto - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League: http://seo.koivi.com/
Jay Moore

2004-03-26, 11:13 pm



Justin Koivisto wrote:
> R.G. Vervoort wrote:
>
>
>
> <select name="testmenu"
> onChange="textfield.value=this.options[selectedIndex].text;">
>


Heh. 5 PHP newsgroups and not a single PHP question. ;)

-Jay

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com