Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Populate Combobox value to textbox

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,59818
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Populate Combobox value to textbox
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Populate Combobox value to textbox - 5/5/2008 2:05:09 AM   
  chanderjeet

 

Posts: 1
Score: 0
Joined: 5/5/2008
Status: offline
Hello guys,

I have trying this for sometime and i have given up. This is whats happening.

1. My script is reading "Address" of records in a Access table.
2. It is populating all the customer addresses one by one in a Combo box.


Now i want that whenever i change the combobox selection the textbox value should also change (realtime). 
To check if its working i provided an "initial" value to the textbox and then tried. But upon changing the textbox goes blank.

Heres the code.

=========================================

<%@ LANGUAGE="VBSCRIPT" %>
<HTML
<BODY>
<FORM>
<font face=verdana size=-1>
From:
<select size=1 name=jump onchange='this.form.address.value=this.options[this.selectedIndex].value'>

<%
Dim DTConn
Dim RecSet
Dim strSQL 
set DTConn = Server.CreateObject("ADODB.Connection")
Set RecSet = Server.CreateObject("ADODB.Recordset")
DTConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Members.mdb")
Set RecSet = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM Memlist"
RecSet.Open strSQL, DTConn
    Do While not RecSet.EOF 
    Response.Write ("<option>")
    Response.Write (RecSet("Address"))
    Response.Write ("</option>")
    RecSet.MoveNext
    Loop 

RecSet.Close
Set RecSet = Nothing
Set DTconn = Nothing
%>
</font>
</select>
<input type="text" name="address" size="50" value="intiial">

</FORM>
</BODY>
</HTML>

=========================================
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Populate Combobox value to textbox Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts