A have a problem. I'm attempting to combine the custom tag TWOSELECTSRELATED with a 
Keyword Search. Here's how it should operate.

The idea is to search by category and 
subcategory only OR by text only OR using both the selects and text 
field. 

When I search using just the two selects related category/subcategory it works fine 
but when I only 
want to use the text field to search the application searches with 
the two selects as well. Definetly not what I want.

I think the problem is that the two selects related is always 
submitted but I don't know how to prevent it from being submitted. 
Any help suggestions appreciated. Here's a code snippet from the form 
page:

<!-- CF_TWOSELECTS BEGINS -->
<br><CF_TwoSelectsRelated
Query="Test1"
Name1="Category"
Name2="Sub_Category"
Display1="Category_Name"
Display2="Sub_Category"
FORCEWIDTH1="30"
FORCEWIDTH2="30"
Formname="Search"
Default1=""
Default2="">

And the action page CFIF statement:

<!-- Check for these variables -->
<cfif (parameterExists(Form.Sub_Category))
AND (Form.Keyword is "")>

<!--- Only a Category is specified --->
<cfset THECriteria = "(CF_Custom2 <MATCHES> #Form.Sub_Category#) ">

<cfelseif (NOT ParameterExists(Form.Sub_Category))
AND (Form.Keyword is not "")>

<!--- Only Keywords are specified --->
<cfset THECriteria = "#Form.Keyword#">

<cfelse>

<!--- Category And Keywords are specified --->
<cfset THECriteria = "(CF_Custom2 <MATCHES> #Form.Sub_Category#)
AND (#Form.Keyword#)">

</cfif>



__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the 
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to