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

Auto populate Text field with combobox's selection

Status
Not open for further replies.

sane79

MIS
Nov 18, 2003
60
SG
Hi all,

I'm pretty new to asp and I need your help here.
Have been trying to figure out this problem for the past 2 days..

I have a form, which requires the user to select a value from the combo box.

Once the value in the combbox changes, the textfields will be populated with the values which will be extracted from the database based on the combobox selection.

My code does not seem to be working.. please help..

=================recordset======================
set rsDetails=Server.createobject("ADODB.Recordset")
sqlStr="select InductionDate, CSR, CSO from CRM_CustomerSalesOrder where SON = '" & Request.QueryString("SON") &"'"
rsDetails.Open sqlStr, dbc
=================================================

===========combo box====================
<select size="1" name="cboSON" onchange="showDetails()">
========================================

=================JS function=====================
<Script language="Javascript">
function showDetails() {
window.location='main.asp?SON='+document.frmMain.cboSON.options[document.frmMain.cboSON.selectedIndex].value;
} </script>
================================================

==========textbox that is to be populated by value=====
<input type="text" name="txtCSR" size="50" value="<%=rsDetails("CSR")%>"></font></td>
======================================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top