Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfinclude, cflocation, frames...how should I do this?

Status
Not open for further replies.

married2themachine

Programmer
Mar 11, 2004
5
US
I need advice on the best way to accomplish something simple [i think]...

I have a report that displays as a default when I go to a page. What i want is to put choices at the top of that page that allow users to select a different report if they don't want the default. I would also like this to occur using radio buttons and perhaps a 'onchange' event?

Example choices:

Current Week-to-date, Saturday, Sunday, Monday, Tuesday, etc.

Underneath the choices above, I want the report displayed. When user makes a different choice, I want their chosen report to display in place of the default. The reports are actually the same file but with a passed variable in the WHERE statement of the query so the choice made above, needs to be passed as a variable so it can be substituted in the report query.

Thank you so much for any direction you can provide.

 
Do you want it to submit when the radio button is clicked? or with a submit button?

It is pretty simple if you use a submit button. If your query Look to see if the form element exists otherwise let your query run in the default manner.

<cfquery...
select fld1,fld2...
from ...
Where TransActionDate >= figure your starting date
<cfif isdefined("form.MyRadioButton")>
<cfif form.MyRadioButton neq 'WeekToDate'>
And DayOfWeek(TransActionDate) = #Val(form.MyRadioButton)#
</cfif>
</cfquery>



Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top