SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 24th, 2003, 11:42 AM
longhorn14 longhorn14 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 11 longhorn14 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dynamic listbox/jump trouble

I am trying to build a dynamic listbox that will load a page when the user selects something. The url that I want to load is competitors.asp?company= and the company that they selected would be part of the querystring. I have gotten the listbox to dynamically load live data, but cannot get it to fire the event that loads the url. Any ideas?
Thanks,
Nathan


<%
' Create the MyConnection Object and Open the connection to the database using your DSN

Set MyConnection = Server.Createobject("Adodb.Connection")
MyConnection.open "DSN=competitors"

' Selection Box
Response.write "<Select name=Myselectbox><option value="""">Please Select</option>"

'Write your Query
MyQuery = "Select company from tblCompany WHERE DirectCompetitor = -1"

'Execute your Query using MyConnection
Set Myrs = MyConnection.Execute(MyQuery)

'Loop until the End of Myrs
Do Until Myrs.eof

'Add all cities till the end of Myrs
Response.write "<option value>" & left(myrs("company"),20)&"</option>"

'Move to the next record
Myrs.movenext
loop

'Close the Selection box
Response.write "</select>"

'Close the recordset
Myrs.close
Set Myrs = nothing

'Close the Connection
MyConnection.close
Set MyConnection = Nothing
%>

Reply With Quote
  #2  
Old October 25th, 2003, 06:13 PM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
There are two events, both with problems: onClick will execute after you clicked on the box but every time you click on it; onChange will execute once the content of the box changes. The pb is that you need to have a dummy "Please select an item" otherwise content will not change for the first item in the list

Reply With Quote
  #3  
Old October 27th, 2003, 11:12 AM
longhorn14 longhorn14 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 11 longhorn14 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you, I have gotten it to work.
Take care,
nat

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Dynamic listbox/jump trouble


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway