You've defined default (scoped) variables on the same page of the form. And then you
hit submit, so that would be a FORM action. So yes, the default params you've defined
are going to be overwritten.
In this case, it would be appropriate to leave the scope out of the default params.
In fact, since you're checking for form variables, you don't even need to define
default params. That should solve your problem.
So in other words, change these:
> <cfparam name="form.training" default="void">
> <cfparam name="form.month" default="void">
> <cfparam name="form.year" default="void">
> <cfparam name="form.region" default="void">
To this:
> <cfparam name="training" default="">
> <cfparam name="month" default="">
> <cfparam name="year" default="">
> <cfparam name="region" default="">
(or simply exclude the default params)
You could then check for the existence of form variables in your dynamic search query.
example:
<cfif Trim(form.training) neq "")>
whatever SQL
</cfif>
--------------------------------------------------------------
Mark Warrick
Phone: (714) 547-5386
Efax.com Fax: (801) 730-7289
Personal Email: [EMAIL PROTECTED]
Personal URL: http://www.warrick.net
Business Email: [EMAIL PROTECTED]
Business URL: http://www.fusioneers.com
ICQ: 346566
--------------------------------------------------------------
> -----Original Message-----
> From: Christopher S Martin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 18, 2000 10:58 AM
> To: [EMAIL PROTECTED]
> Subject: [CF-Talk] Incorrect use of CFPARAM?
>
>
> Hello everyone. I have a page that has a bunch of pull down menus that a
> user can use to search a database.
>
> At the beginning of the template, I have a bunch of CFPARAMS:
>
> <cfparam name="form.training" default="void">
> <cfparam name="form.month" default="void">
> <cfparam name="form.year" default="void">
> <cfparam name="form.region" default="void">
>
> the actual selects look like:
> <cfselect name="region">
> <option value="void">  
> <option value="1">Northeast
> <option value="2">Southeast
> <option value="3">Southwest
> <option value="4">Midwest
> <option value="5">Western
> <option value="6">Mid-Atlantic
> <option value="7">Northwest
> </cfselect>
>
> The actual action of the search is on the page itself. Anyway, when I
> select a region and hit submit, the cfparam statement overwrites the
> variable I am trying to search by. Shouldn't the cfparam only
> overwrite the
> statement if it is not defined?
>
> Thanks in advance
>
> Chris Martin
> [EMAIL PROTECTED]
> www.fsenablers.com
> www.fslink.com
>
>
> ------------------------------------------------------------------
> ------------
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message
to [EMAIL PROTECTED] with 'unsubscribe' in the body.