codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Add an OnChange event to an ASP page  fiorano1 at 08:11 on Thursday, December 18, 2008
 

Hi,

I have the following code to access an SQL table and 'dynamically' populate a listbox.

What I would like to do is add an onchnage event where the selected value is placed in a Textfield on the same page.




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Drop Down Test</title>
</head>
<body>
<%
dim directorate
directorate = session("Directorate")

dim strSQL
set Conn=Server.CreateObject("ADODB.Connection")
DSN="Driver={SQL Server};Server=BROINFO;Database=ref_datadb;UID=sa; PWD=inforep"
Conn.Open(DSN)
strSQL = "SELECT Main_specialty_description as 'spec_code' FROM main_specialty_look_up where rtrim(directorate) = '" & directorate & "' order by main_specialty_description"
set RS = Conn.execute(strSQL)
Response.Write "<select name=spec_code ><option value='''' selected>Please Select</option>"
Do While Not RS.EOF
Response.Write "<option value=''" & RS("spec_code") &"''>"& RS("spec_code") &"</option>"
RS.MoveNext
Loop
Response.Write "</select>"
Rs.Close
conn.Close

%>

</body>
</html>



Any JS experts able to help???

Thanks

Fiorano1








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Microsoft Access (VB) Question
•  Add an OnChange event to an ASP page
•  value of text field
•  value of text field
•  Perl Critic trouble
•  OPENING FOR: PERL (Developer/ Senior/ Team Lead)
•  Re: Help with code
•  remove character on a line of a file with check box
•  Pulling Data from 2 tables with variables from a 3rd table!!!


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008