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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving value of combo box

Status
Not open for further replies.

Charlix

Programmer
Nov 19, 2002
85
US
I have a combo box (<SELECT Name = "Defect" >) and a text box (Name = "txtDefect"). I want to copy the value of the combo box into the text box on change. However, it only transfers the value up to the first space.

The code I use is:

********************************************
<Script Language="VBScript" >
Sub Defect_onChange
theForm.txtDefect.Value = theForm.Defect.Value%
End Sub
</Script>
************************************************

I tried:
*******************
theForm.txtDefect.Value = "<%=theForm.Defect.Value%>"
*********************

but I get an error message: "variable not defined". Defining the variables doesn't help.

Any suggestions.

Charlix


 
trying to do client side on server side with the <%%>

try :

<select name="Defect" onchange="javascript:document.getElementById('txtDefect').value = this.value;">
 
DreXor:
I tried your suggestion, but I must be doing something wrong. It doesn't seem to correct not picking up anything after a space.

Charlix
 
forum329

___________________________________________________________________

The answer to your ??'s may be closer then you think. faq333-3811
Join the Northern Illinois/Southern Wisconsin members in Forum1064
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top