http://www.webtricks.com/sourcecode/code.cfm?CodeID=18

http://www.macromedia.com/cfusion/exchange/index.cfm#loc=en_us&view=sn106&viewName=Exchange%20Search%20Details&authorid=7653985&page=0&scrollPos=0&subcatid=0&snid=sn106&itemnumber=13&extid=1000288&catid=0

  ----- Original Message -----
  From: Daniel Farmer
  To: CF-Talk
  Sent: Tuesday, January 06, 2004 12:54 PM
  Subject: Re: CF / _javascript_ question

  I'm not sure what you're doing here. But why not just put the select fields into a seperate templates and then call them as you need to? ( cfinclude )
    ----- Original Message -----
    From: Steve Logan
    To: CF-Talk
    Sent: Tuesday, January 06, 2004 2:49 PM
    Subject: CF / _javascript_ question

    I was looking around for a code example of this and haven't been able to
    find one - it's definitely something that's been on my list of "must learn"
    - now it's a need to learn item.

    I have 2 tables in my db - one is partcategory and one is partsubcatetory.
    I have a CF snippet set to create a form select pulldown off of the first
    table, but what I want to have happen is when they make a selection from the
    first pull down (onChange) run a 2nd query to populate the subcategory with
    the appropriate items.

    The part category pulldown select code is this:

    <!--- part cat select pulldown --->
    <cfquery name="selPartCat" datasource="#Session.DSN#">
       select * from partcategory
    </cfquery>
    <cfparam name="PartCategorySelect" default="">
    <cfparam name="FindCategory" default="">
    <cfset PartCategorySelect=PartCategorySelect & '<option value="0"'>
    <cfset PartCategorySelect=PartCategorySelect & ">" & "--Make A Selection--">
    <cfoutput query="selPartCat">
      <cfset PartCategorySelect=PartCategorySelect & '<option
    value="#selPartCat.pc_id#"'>
      <cfif pc_id eq FindCategory>
    <cfset PartCategorySelect=PartCategorySelect & "
    selected">
    </cfif>
      <cfset PartCategorySelect=PartCategorySelect & ">" &
    #selPartCat.pc_category#>
    </cfoutput>
    <cfset PartCategorySelect=PartCategorySelect & "</select>">
    <cfset PartCategorySelect='<select name="PartCategorySelect">'  &
    PartCategorySelect>

    <!--- end part cat pulldown --->

    <cfoutput>#PartCategorySelect#</cfoutput>

    This gives me a nice pulldown with the correct values and selection names.
    Now I'm stuck on the _javascript_ to get the 2nd query / pulldown to be
    created.

    Thanks.

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

Reply via email to