View Single Post
Old 04-11-2005, 04:01 AM   #1 (permalink)
awieds
Registered User
 
Join Date: Mar 2005
Posts: 42
awieds is on a distinguished road
reset Variable in HTML

I think this is fairly simple but I am stuck on it. I have a page with a menu where the user selects something. based on what he selects I run a query and set a variable. (All this I've done)
Now I have a textbox and I want to set it to that variable. It's set, and onChange the variable changes but how do I reset the texbox to the new value of the variable? Here are the snippets from my code:

Code:
sub DescTest(prod)
	dim desRS
	dim strSelect
	Set desrs = Server.CreateObject("ADODB.Recordset")
	strSelect="Select description from productdescription where productid= " & prod
	desrs.Open strSelect, MM_myConn_STRING, 3, 2 ,1
	
	strDescription=desRS("description")
	rs.close()
end sub

<select name="Products" id="products" onChange="DescTest()">
			<%dim j
			for j=lbound(arrproducts) to ubound(arrproducts)-1%>
				<option value=<%=arrproducts(j,1)%>><%=arrproducts(j,0)%></option>
			<%next%>
		</select>


<textarea  name="description" cols="65" rows="9"><%=strdescription%></textarea>
awieds is offline   Reply With Quote