Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop down lists

Status
Not open for further replies.

barrylowe

Programmer
Nov 6, 2001
188
GB
I have put a drop down list on my page using the CFSELECT tag. The list is populated from a query.

When an item is selected from the list I want the text to appear in another text box as well as in the list. I can get the selectedindex value to appear using the onchange event, but not the text.

Any help would great!
 
supposing your HTML looks like this:
<SELECT NAME=&quot;name&quot;>
<OPTION VALUE=&quot;value1&quot;>value1
<OPTION VALUE=&quot;value2&quot;>value2
...
</SELECT>

try putting this object into the text box - document.forms[0].name.options[document.forms[0].name.selectedIndex].value
 
try this i think this is what you are trying to do..
<form name=&quot;form&quot;>


<select name=&quot;FName&quot; onChange=&quot;this.form.FName2.value=this.value;&quot;>
<option>select 1</option>
<option value=&quot;test&quot;>test </option>
<option value=&quot;test 2&quot;>test2</option>
<option value=&quot;test 3&quot;>test 3 </option>
</select>
<br>
<input type=&quot;text&quot; name=&quot;FName2&quot;>
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top