- see footer for list info -<
The best way I can describe this is to give you a link.
http://www.bgfl.org/cfpages/calendar
If you click the known issues link you will see an a-z list and a drop down
box. The drop down box shows the schools which have the first letter chosen
from the a-z list.
I have a line of code
<select name="selected_School" onChange="this.form.submit()">
So that when the the list is changed known issues (if there are any) are
shown in a box below.
The problem is that this doesn't work first time around. (becuse ther is no
'onChange'.
So how do I force it to bring back known issues for the current school in
the drop down list. It will need to see the letter selected each time too?
I guess I could make a query that brings back the first record each time a
letter is chosen but is there a better way ...?
Regards - Paul
The queries so far ....
<!--- Set the letter to 'A' if no letter is passed in the URL --->
<cfif not isdefined("url.letter")>
<cfset url.letter = 'a'>
</cfif>
<!--- Get the first letter of all of the schools to produce the a-z list
--->
<cfquery name="select_az" datasource="#Application.SchoolsDSN#">
SELECT DISTINCT LEFT(SchoolName,1) AS letter
FROM tblSchools
ORDER BY LEFT(SchoolName,1)
</cfquery>
<!--- Get the schools that start with the first letter passed in the URL
--->
<cfquery name="GetSchools" datasource="#Application.SchoolsDSN#">
SELECT SchoolIDPK, SchoolName
FROM tblSchools
WHERE LEFT(SchoolName,1) = '#URL.Letter#'
ORDER BY SchoolName
</cfquery>
and when the form is submitted to itself ....
<cfif isdefined("form.selected_school")>
<cfquery name="GetIssues" datasource="#application.CalendarDSN#">
SELECT IssueIDPK,
SchoolIDFK,
ReportedBy,
ReportedDate,
Issue,
ActionedBy,
ActionDate,
IssueAction
FROM tblIssues
WHERE SchoolIDFK = #form.Selected_School#
</cfquery>
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<