Click to See Complete Forum and Search --> : drop down menu value in onchange command
TheSkyOrBust
09-06-2007, 07:39 AM
I'm trying to get the values of options in a drop down menu placed as the value of a textbox. I have tried a few combinations with onChange, but I'm a bit of a HTML moron so I don't know what else I can try. Any help will be great.
felgall
09-06-2007, 07:59 AM
Well onchange is JavaScript not HTML. Assuming you have the form, textbox, and select named as in the following then the onchange coded as shown should copy the value from the selected option to the textbox.
<form name="formname">
<input type="text" name="textbox">
<select name="selectname"
onchange="document.formname.textbox.value = document.formname.selectname.options[document.formname.selectname.selectedIndex].value">
...
TheSkyOrBust
09-06-2007, 08:02 AM
Told you I was a moron. Thank you very much.