| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Website Designer
Join Date: May 2007
Posts: 7
|
[JavaScript] Ugh...
I have a dropdown box that loads the name and ID of images stored in a MySQL (viai PHP) into a dropdown box. I need to have a script so when a button is pressed a string + the image id (var basically) + another string are inserted into a text box. Eg: Dropdown box: <option name="ID">an image</option> now when a button is clicked -> add 'str' + ID + 'str' to a textbox. Any help anyone? |
|
|
|
|
|
#2 (permalink) |
|
I like code.
|
Well you can get the name and value of the selected dropdown like so, I believe. Code:
then to add it to a textbox Code:
I think that might work. You can replace forms[0] with your form name and selectName and textBoxName are the names of the select and textbox e.g. Code:
|
|
|
|
#5 (permalink) |
|
I like code.
|
Ok here is a working example with functions and all. HTML Code:
|
|
![]() |