Select function issue
Hello;
I am trying to write a little nav using a select menue. This page is a dynamic page, you can only get to it when there is an URL.ID, if there is not one, it kicks you back to the page that spawns the details page. I have it locked down pretty well with the url.ID, I added the select nav on the detail page so people won't have to go back to the main page for the list of records in that part of the db, and they won't have to cycle through number 1-12 to find a record they want to pull up.I have 2 queries running this. I will comment it out and mainly focus on the select function.
This is the MAIN query, this one runs the page and outputs the info for the details of the records I am bring up. This works fine from the main page link using url.id
<cfquery name="GetRecordevent" datasource="#APPLICATION.dataSource#">
SELECT events.display AS ViewField1, events.title AS ViewField2, events.eventDate AS ViewField3, events.eventTime AS ViewField4, events.location AS ViewField5, events.contact AS ViewField6, events.phone AS ViewField7, events.fax AS ViewField8, events.email AS ViewField9, events.URL AS ViewField10, events.sponsor AS ViewField11, events.Body AS htmlList, events.ID AS ID
FROM events
WHERE events.ID =<cfqueryparam value="#URL.ID#" cfsqltype="cf_sql_integer">
</cfquery>
now this is the tag that locks down the detail page:
<cfif (isDefined ("URL.ID")) OR (isDefined ("value.id"))>
they get the info on this page
<cfelse>
<cflocation url="index.cfm" addtoken="no">
</cfif>
this is the select function and query that populates it with the titles of records and the id
<CFQUERY name="cata" datasource="#APPLICATION.dataSource#" cachedwithin="#CreateTimeSpan(0, 6, 0, 0)#">
SELECT events.title AS ViewField2, events.ID AS ID
FROM events
</CFQUERY>
<cfform Name="eventnav" method="post" Action="detail.cfm?value=#ID#">
<select name="ID" size="1" class="selectstyle" onChange="eventnav.submit();">
<option value=""> --Select an Event-- </option>
<CFOUTPUT query= "cata">
<option value="#ID#">#ViewField2#</option>
</CFOUTPUT>
</select>
</cfform>
now my query is not recognizing the value.id in the url from the select function action part of the form. I tried adding a AND statement and changed it to an OR statement, neither one works. What do I need to do to either change the select function to match a url.id or add to my main query that the select function needs to pull a record?I'm a little confused, my lockdown works as it is with teh OR in it. But my main query is not liking what I am doing.Can anyone help me figure out how to make this work properly?Thank you.Codemonger
