You could use <cfif> around the select statement and just drop the line...
<html>
<select name="County" size="1">
<option value="All" selected>All</option>
<sql>
WHERE tblCustomer.CategoryID = #attributes.CategoryID#
<cfif attributes.county neq "all">
and
County = '#attributes.County#'
</cfif>
----- Original Message -----
From: David Crowther <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 04, 2000 3:37 AM
Subject: <select> and defaulting to "All"
: I am providing a compound search option in a site that I am coding. The
two
: search choices are by County and Category.
: I want to set the default option to "All" (all the counties) in the County
: field.
:
: For example:
:
: <select name="County"
: size="1">
: <option value="*" selected>All</option>
: <option value="Aberdeenshire">Aberdeenshire</option>
: <option value="Anglesey">Anglesey</option>
: <option value="Angus">Angus</option>
: <option value="Antrim">Antrim</option>... etc
:
:
: And my query code:
:
: <cfquery name="getSearchResults" datasource="#application.database#"
: dbtype="ODBC">
: SELECT
: tblCustomerDetails.CustomerID,tblCategories.CategoryID,CompanyName,County
: FROM ((tblCustomer inner join tblCustomerDetails on
: tblCustomer.CustomerID = tblCustomerDetails.CustomerID)
: inner join tblCategories on tblCustomer.CategoryID =
: tblCategories.CategoryID)
: WHERE County = '#attributes.County#'
: AND tblCustomer.CategoryID = #attributes.CategoryID#
: ORDER BY CompanyName
: </cfquery>
:
: As you can see I have tried using a * as the first option in my <select>
: tag, but unfortunately this does not work.
:
: Does anyone have an idea how I can get this to work... many thanks in
: advance.
:
: David
: --------------------------------------------------------------------------
----
: To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
:
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.