When the manufacturer is selected, you would have a onChange="document.myForm.submit()" in the
Close
Login to Your Account

Need help with an array design - Macromedia ColdFusion

Hi, I need a little help in designing an array for use on a search page. I will have one select list with names of a manufacturer that the user will select. This will be a static list. Upon the user selection the second select list will populate and show the chosen manufacturers products for selection. I have 12 manufacturers with an average of 8-14 product categories each. Once the product is chosen the user would click on the submit button to return the master search page with a listing of product in this category. Sorry but I am very ...

  1. #1

    Default Need help with an array design

    Hi, I need a little help in designing an array for use on a search page.

    I will have one select list with names of a manufacturer that the user will
    select. This will be a static list. Upon the user selection the second select
    list will populate and show the chosen manufacturers products for selection. I
    have 12 manufacturers with an average of 8-14 product categories each. Once
    the product is chosen the user would click on the submit button to return the
    master search page with a listing of product in this category. Sorry but I am
    very new to CF 7 so if someone is up to a lengthy explaination it would be much
    appreciated.

    So far these forums and all of the help provided has been a great resource!

    Shane

    Shane930 Guest

  2. #2

    Default Re: Need help with an array design

    Your basic logic could be as follows:

    Build a page that has your first and second select lists. When the page is
    initially loaded, only the first one (manufacturers) shows on the page. Make
    sure your <FORM> tag has the name attribute in it - for example, myForm. And
    make the action page point to this page - that is, reload the page.

    <FORM NAME="myForm" ACTION="thisPage.cfm?howMany=#loadCount#">
    <CFSET loadCount = loadCount + 1> <!--- more on this later --->

    When the manufacturer is selected, you would have a
    onChange="doent.myForm.submit()" in the <SELECT> tag and the form is
    submitted. The page reloads, this time the second select list shows up,
    populated from a database query on the manufacturer. You can either use the
    onChange construct shown above to cause the form to be submitted, or use a
    conventional submit button.

    Make the page smart enough to know whether it is the first, second or third
    time it has been loaded. At the top of the page, have a <CFPARAM
    NAME="loadCount" DEFAULT = 0> that initializes loadCount to zero if it does not
    already exist. On load 2 and 3, it already exists since it is being passed in
    the URL.

    That's about it. Good luck.


    jdeline Guest

Similar Threads

  1. Replies: 5
    Last Post: September 17th, 07:54 PM
  2. array data matches but array created in loop doesn't work
    By Reed Law in forum PHP Development
    Replies: 1
    Last Post: August 13th, 04:25 AM
  3. Replies: 5
    Last Post: August 12th, 11:48 AM
  4. #24897 [Com]: array_multisort() will reindex the array but not if array length is 1
    By franklin_se at hotmail dot com in forum PHP Development
    Replies: 0
    Last Post: August 2nd, 03:29 PM
  5. Replies: 0
    Last Post: August 1st, 12:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139