http://hotwired.lycos.com/webmonkey/98/04/index3a_page10.html?tw=programming
<http://hotwired.lycos.com/webmonkey/98/04/index3a_page10.html?tw=programmin
g>

This might be an option for what you want.  HTH.

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-----Original Message-----
From: Sam Fisher [mailto:[EMAIL PROTECTED]
Sent: Monday, September 29, 2003 12:51 PM
To: CF-Talk
Subject: Re: Re:dynamic menus


Thanks, L.  Unfortunately I'm dense and am having trouble making sense of
the code you sent me.  Suppose I have two lookup tables, (a) is for three
types of Apples [red, golden, grannysmith], and the other (b) is for Nuts
[walnut, chestnut, pecan, peanut].

The criteria are such that
1) Each Apple-type can have only one Nut-type.
2) red apples can only be paired up with a chestnut or a pecan.
3) golden apples can only be paired up with a walnuts or a chestnut.
4) grannysmith apples can only be paired up with any type of nut.

-I write a query to get all of my Apples listed in a drop-down menu.
-I write a query for each situation possibly selected.  So for red I'd write
something like:
    <CFQUERY name="redlist">SELECT nut FROM tblNUTS WHERE nut = 'chestnut'
OR nut = 'pecan'</CFQUERY>

So how do I create the form?  I guess I'm not understanding how multiple
lists can be mixed and matched.  I still feel that I need a switch to handle
the specific cases.  Perhaps I'm not looking for a dynamic menu system.
Anyway, sorry to bug you again.  Your help is very welcome.

Thanks,
-S
  ----- Original Message -----
  From: [EMAIL PROTECTED] [EMAIL PROTECTED]
  To: CF-Talk
  Sent: Sunday, September 28, 2003 4:40 PM
  Subject: Re:dynamic menus


  Try this. I'm a big fan of NOT using CFFORM etc.

  Note the onChange event - very straightforward.

  And this way you need only one list (no case statement needed).



  ======================
  <cfparam name="FORM.author_id" default="">


  <cfquery name="Alist" datasource="word">
  SELECT
  author_id,
  author_first_name
  FROM
  author
  ORDER BY author_first_name
  </cfquery>
  <form method="post" name="listForm">
  <select name="author_id" >   <option value="">-- SELECT --</option>
  <cfoutput query="Alist">
  <option value="#author_id#" <cfif #FORM.author_id# EQ
#Alist.author_id#>selected</cfif>>#author_first_name#</option>
  </cfoutput>
  </select>
  </form>=========================

  _____  

[ Todays Threads
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to