What you are attempting to do will not work this way.  Cold Fusion processes the page 
on the server and returns HTML to the client.  If someone choices something in select 
box 1, you cant run a query to get select box two unless you submit the page again.

There are 3 options I know of.

1. After select box 1 is picked use Javascript to do an onchange to reload the page 
and pass the form field in and reload the page with select box 2 data.

2. Depending on the # of possible result sets hard code the values in javascript based 
on the 1st select box only certain things in select box are shown.

3. Use urlPipe from kisai.com which is a free java applet that allows you to make a 
call to a page to get information live and populate the select box.  I havent has much 
exeperience with this but if you do some research on this way would be the best and 
coolest way to do it.
If anyone has any good example is this please post.

---------- Original Message ----------------------------------
From: "WL" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Fri, 23 Jun 2000 23:24:59 +0100

>

> If I understand you correctly, you want the second version of your SQL
> statement to happen only if the user selects a category, otherwise use the
> first.

OK well I've uses your idea but have come across a really irritating
problem.  Obviously this select is only on the 2nd page, but the error is
"the specified form object cannot be found" - why?  It's there, it's
specified, why can't it see it?!

I'm sorry I'm being so dumb..here's my code:

<cfquery name="County" datasource="localads"  >
SELECT county FROM locations
</cfquery>
<form name="area" method="post" action="categories2.cfm">
  <select name="area">
    <cfloop query="County">
      <option
value="<cfoutput>#County.county#</cfoutput>"><cfoutput>#County.county#</cfou
tput></option>
      </cfloop>
  </select>
  <input type="submit" name="Submit" value="Submit">
</form>

<cfquery name="category" datasource="localads"  >
SELECT * FROM categories WHERE id = 1
<cfif #form.area# is not "">
AND county is '#form.area#'
</cfif>


Seems fine to my eyes :(

TIA

Will

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to