[thelist] <select> and defaulting to "All"

David Crowther david at SITD.COM
Fri Aug 4 05:20:34 CDT 2000


I am providing a compound search option in a site that I am coding in
ColdFusion. 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 = '#form.County#'
		AND tblCustomer.CategoryID = #form.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

<tip type="Photoshop 5.5">
Don't forget in Photoshop 5.5 to tick the "Only Web Colors" box in the Color
Picker when you want to make sure your web site is web safe.
</tip>




More information about the thelist mailing list