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
For each dropdown box or checkbox, have 3 choices:
Y = Yes - I need this
N = No - I do not want this
D = Doesn't matter
When you go to set up the sql statment, do something like:
Select col1,col2,col3,etcfrom amenities
Where (1=1)
And ( hottubs = #hottubs# )
And (
Patty -- Checkboxes might solve your problem 'cuz they only get passed as form values
if they're *checked.* Therefore, your query could simply string together only the
passed checkboxes for the Boolean case you describe below. The user says 'This
doesn't matter' by simply not checking a parti
if you use checkboxes for the selections, use isDefined() on your action
page. if the checkbox for that selection is defined, include it in your
where clause
ex:
SELECT
WHERE
AND
chris olive, cio
cresco technologies
[EMAIL PROTECTED]
http://www.crescotech.com
-Original Mes
just set a condition to not do a WHERE statement in your SQL if they choose
"it don't matter"
- Original Message -
From: P@tty Ayers <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Wednesday, April 04, 2001 11:30 AM
Subject: How to Allow a "Doesn't Matter" Variable in a Search?
Why not use radio inputs? This way you can have something like this...
Search for properties with...
HotTub?
Not Important.
I Need a Hottub!
Pool?
Not Important.
I Need a Pool!
Validate on the second page...
SELECT * FROM Listings
WHERE 1 = 1 // get's around having a default WHERE Claus
If you have a checkbox for the 'Don't Matter' or dont include, then
assign it a value then in the WHERE clause of the SQL test the value
and if it is one of those cases, do not include it in the SQL
Something along the lines of:
Select *
>From MyTable
Where checkboxresults = 1
-Original
Well if it doesn't matter just don't pass the parameter have it set with a
value of "" and
then when you run the query where hottub =
Yesetc
that way if they pass the parameter blank it won't include it in the search,
hence pulling
up records that do and/or don't include hottubs. Is that what you
8 matches
Mail list logo