The easiest way would be to simply _not_ include that field in the 
WHERE clause of your query. The default characteristic of HTML 
checkboxes helps because, if no elements for the checkbox group 
are 'checked' or given default values then the variable is not passed 
to the ACTION target.

SELECT *
FROM Properties
WHERE ... <CFIF isDefined("FORM.Hottub")>AND HOTTUB = FORM.Hottub</CFIF>

Steve


----- Original Message -----
From: "P@tty Ayers" <[EMAIL PROTECTED]>
Date: Wednesday, April 4, 2001 1:30 pm
Subject: How to Allow a "Doesn't Matter" Variable in a Search?

> Friends:  Can anyone help with this problem I'm stuck on? Not sure 
> if this
> is a simple one or not, but in any case I'll sure be delighted to 
> get it
> working.
> 
> This set of pages allows the user to search a set of records using 
> 9 search
> objects. Four of those are for searching yes/no (1/0) fields in the
> Access2000 database.
> 
> For the four search fields which search yes/no columns, I  want 
> them to
> choose either "This doesn't matter - don't include this in the 
> search" OR
> "Include only records with "yes" (1) in this column. They need to 
> be able to
> specify that they want to see only rental properties that have a 
> hot tub, or
> else that this doesn't matter to them.
> 
> Obviously this differs from offering the choice between "Include only
> records with 'yes' in this column" and "Include only records with 
> 'no' in
> this column", which is *not* what I need to do here.
> 
> This could be done with checkboxes or a menu - but I can't figure 
> out how to
> allow that "This doesn't matter" search parameter.
> 
> Thanks very much in advance for your help!
> 
> 
> P@tty Ayers
> Macromedia Evangelist
> 
> Dreamweaver Resources, FAQs, and Tutorials:
> http://www.thepattysite.com/dreamweaver/
> 
> P@tty's ColdFusion Site
> http://carolina.cf-developer.net
> 
> Carolina Web Solutions
> http://www.carolinawebsolutions.com
> 
> "Design in art, is a recognition of the relation between various 
> things,various elements in the creative flux. You can't invent a 
> design. You
> recognise it, in the fourth dimension. That is, with your blood 
> and your
> bones, as well as with your eyes."  - D. H. Lawrence
> 
> "Well-behaved women seldom make history."  - Anonymous
> 
> 
> 
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to