You need to have a table tblEvents with atleast following fields.
EventName
EventDescription
EventDate
Then in the onChange event of the month dropdown, you can submit the selected month to a page, say events page. Let cboMonth be the name of the drop down. The values of options of cboMonth goes from 1 to 12.
In events page, you can write the script as below.
dim qryGetEvents
dim rstGetEvents
qryGetEvents="SELECT EventName, EventDate FROM tblEvents WHERE MONTH(EventDate)=" & Request.Form("cboMonth")
Set rstGetEvents=Server.CreateObject("ADODB.RecordSet" )
rstGetEvents.Open qryGetEvents, connection_object, adOpenForwardOnly
if(not(rstGetEvents.Eof or rstGetEvents.Bof)) then
rstGetEvents.MoveFirst
While(not(rstGetEvents.Eof))
Response.Write rstGetEvents("EventName") & " on " & cstr(rstGetEvents("EventDate")) & "<br><br>"
rstGetEvents.MoveNext
Wend
else
Response.Write ("There are no events in " & monthname(Request.Form("cboMonth")))
end if
rstGetEvents.Close
Set rstGetEvents=Nothing
In this piece of code connection_object is the connection object which points to your database. The setting of this will depend on the particular database and driver you plan to use.
|