Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Web form combobox on update firing event

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Web form combobox on update firing event
  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 >>
 Web form combobox on update firing event - 6/27/2005 1:09:33 AM   
  NigeJK

 

Posts: 16
Score: 0
Joined: 6/27/2005
From:
Status: offline
I have some code in an ASP page that fills my combobox with values from my database table. I want to fire an event when I select a value from the combo box.

Here is my code so far :-

<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<BODY>
<BR>eDiary Setup Page<BR>
<!-- insert the ActiveX control into the HTML page -->
<OBJECT ID="ComboBox" WIDTH=96 HEIGHT=26
CLASSID="CLSID:8BD21D30-EC42-11CE-9E0D-00AA006002F3">
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
' load the ActiveX control after the window has been loaded
Sub Window_OnLoad()
<% Set conn = Server.CreateObject("ADODB.Connection") %>
<% conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("eDatabase.mdb") ' connect to the database %>
<% Set rs = conn.Execute("SELECT FirstName FROM eStaff") %>
<% Do While Not rs.EOF %>
ComboBox.AddItem("<%= rs("FirstName") %>") ' Do an AddItem for
' each record
<% rs.MoveNext %>
<% Loop %>
<% rs.Close %>
<% conn.Close %>
End Sub

-->

</Script>
</BODY>
</HTML>
 
 
Post #: 1
 
 Re: Web form combobox on update firing event - 6/27/2005 7:36:22 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
I think you would have to put in onChange="SUB"

(in reply to NigeJK)
 
 
Post #: 2
 
 Re: Web form combobox on update firing event - 6/27/2005 8:44:43 PM   
  NigeJK

 

Posts: 16
Score: 0
Joined: 6/27/2005
From:
Status: offline
I have solved the problem by using an alternative event as follws :-

<SCRIPT FOR = "ComboBox" EVENT = "ondeactivate" >
//code...//
</SCRIPT>

(in reply to NigeJK)
 
 
Post #: 3
 
 
 
  

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 >> Web form combobox on update firing event 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