Assume for a moment that I have this code that dynamically populates a
dropdown listbox by querying the database(and this code works by the way),
how can I get this code populate an input textbox?
In other words, I want to select a value from this dropdown and populate an input textbox with value selected.
I am bit up by this code.
Can you please bell me out again?
Thanks in advance.
Below is what I have so far.
dropdown listbox by querying the database(and this code works by the way),
how can I get this code populate an input textbox?
In other words, I want to select a value from this dropdown and populate an input textbox with value selected.
I am bit up by this code.
Can you please bell me out again?
Thanks in advance.
Below is what I have so far.
Code:
<script>
function moveText()
{
window.document.testform.testtext.value = window.document.testform.street.options[window.document.testform.street.selectedIndex].value
}
</script>
<body>
<table>
<tr>
<td><select name="street" size="1" name="street" onChange="moveText()">>
<option selected><Choose One></option>
<option>------------------------------------------------</option>
<%
dim Conn,SQLstr
Function OpenDBFConn(Path)
Dim Conn: Set Conn = CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Path & ";" & _
"Extended Properties=""DBASE IV;"";"
Set OpenDBFConn = Conn
End Function
Dim DBConn
Set DBConn = OpenDBFConn("\\tpd")
'Open recordset from basins table
Dim rsWaterShed
Set rsWaterShed = DBConn.Execute("SELECT * FROM table order by site_code")
While not rsWaterShed.EOF
%>
<OPTION value="<%=rsWaterShed(1)%>"><%=rsWaterShed(1)%></OPTION>
<%
rsWaterShed.MoveNext
wend
rsWaterShed.close
set rsWaterShed=nothing
%>
</select></td>
<td><input type="text" name="testtext" size="30"></td>
</tr>
</table>
</body>