Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 TWO dropdown menus
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Presario
Starting Member

46 Posts

Posted - 20 April 2008 :  08:04:07  Show Profile
HELP!! lol

Im struggling to work out how to set up TWO dropdown menus that consist of the same information - in this case football managers names.

The reason I need two dropdown menus is so users to my site can choose TWO different peoples names (one from each menu) and they will be given the statistics of those people so they can be compared.

I run a non-league football (soccer) website and I am trying to allow visitors the opportunity to look at individual `past` managers and compare them to one-another. ie, games managed, won, lost etc etc.

I can do it with ONE dropdown but cannot find anywhere which shows how to set up TWO dropdowns and then drag the info from a database?

Any help would be highly appreciated...



Edited by - Presario on 20 April 2008 08:04:32

Presario
Starting Member

46 Posts

Posted - 20 April 2008 :  08:56:30  Show Profile
A perfect example of what IM looking to do can be found here :

http://www.footymad.net/head-to-head-statistics/

Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 21 April 2008 :  19:38:38  Show Profile
Well the front end will be something like

strSql = "SELECT <<BLAH>> FROM <<TABLE>>"
set rs = Server.CreateObject("ADODB.Recordset")
rsUser.open strSqlUser, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

if rs.EOF then
	recCount = ""
else
	allData = rs.GetRows(adGetRowsRest)
	recCount = UBound(allData,2)
end if

rs.close
set rs = nothing

if recCount <> "" then
	Response.Write "<select name=""<<name here>>"">"
	for x = 0 to recCount
		Response.Write "<option value =""" & allData(0,x) & """>" & allData(0,x) &"</option>"
	next
	Response.Write "</select>"
	Response.Write "<select name=""<<name here>>2"">"
	for x = 0 to recCount
		Response.Write "<option value =""" & allData(0,x) & """>" & allData(0,x) &"</option>"
	next
	Response.Write "</select>"
else
	Response.Write "NO <<BLAH>> FOUND!"
end if

This isn't perfect as one can select the same person but I'm sure someone know the javascript to change that.

But to code the back end we would need to know a little more how your db is set up and what you want.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07