Professional Web Applications Themes

Flash Form Checkboxes - Macromedia ColdFusion

I have the following query: <cfquery name='getProducts' datasource='annmeet'> SELECT p.ProductID, p.ProductName FROM Product p ORDER BY p.ProductName </cfquery> I have this code in my cfmx7 flash form <cfformgroup type='repeater' query='getProducts'> <cfinput type='checkbox' name='product' label='{getProducts.currentItem.ProductName}' value='{getProducts.currentItem.ProductID}'> </cfformgroup> The labels come out fine, but all the boxes are checked. I'm just trying to do a checkbox loop to get values and names. Am I way off? Thanks....

  1. #1

    Default Flash Form Checkboxes

    I have the following query: <cfquery name='getProducts' datasource='annmeet'>
    SELECT p.ProductID, p.ProductName FROM Product p ORDER BY
    p.ProductName </cfquery> I have this code in my cfmx7 flash form <cfformgroup
    type='repeater' query='getProducts'> <cfinput type='checkbox' name='product'
    label='{getProducts.currentItem.ProductName}'
    value='{getProducts.currentItem.ProductID}'> </cfformgroup> The labels come
    out fine, but all the boxes are checked. I'm just trying to do a checkbox loop
    to get values and names. Am I way off? Thanks.

    johnnyred Guest

  2. #2

    Default Re: Flash Form Checkboxes

    Checkboxes are really only a true/false value. So technically the value=""
    attribute is used to determine if it is selected or now. So if it's false,
    it's not selected, if it's true or anything else it is selected.

    You might want to try radio buttons instead.

    Or, since it appears all the users of this form will get the same list of
    products you can use cfloop instead of the repeater, and then give each
    checkbox a unique name.

    hth,
    ----nimer


    "johnnyred" <webforumsusermacromedia.com> wrote in message
    news:cuvpf3$9dj$1forums.macromedia.com...
    >I have the following query: <cfquery name='getProducts'
    >datasource='annmeet'>
    > SELECT p.ProductID, p.ProductName FROM Product p ORDER
    > BY
    > p.ProductName </cfquery> I have this code in my cfmx7 flash form
    > <cfformgroup
    > type='repeater' query='getProducts'> <cfinput type='checkbox'
    > name='product'
    > label='{getProducts.currentItem.ProductName}'
    > value='{getProducts.currentItem.ProductID}'> </cfformgroup> The labels
    > come
    > out fine, but all the boxes are checked. I'm just trying to do a checkbox
    > loop
    > to get values and names. Am I way off? Thanks.
    >

    Mike Nimer Guest

  3. #3

    Default Re: Flash Form Checkboxes

    I am trying to duplicate something I did in HTML. A company selects any number
    of categories it feels are appropriate for itself. The looped values are
    submitted to a 2 column table (CompanyNumber,productID). I know how to do
    this if all the checkbox names are the same, I am having trouble with the names
    being different. Would I evaluate the variable (evaluate (ProductID &amp; i))?
    Thanks.

    johnnyred Guest

  4. #4

    Default Re: Flash Form Checkboxes

    I am trying to duplicate something I did in HTML. A company selects any number
    of categories it feels are appropriate for itself. The looped values are
    submitted to a 2 column table (CompanyNumber,productID). I know how to do
    this if all the checkbox names are the same, I am having trouble with the names
    being different. Would I evaluate the variable (evaluate (ProductID &amp; i))?
    Thanks.

    johnnyred Guest

  5. #5

    Default Re: Flash Form Checkboxes

    do you mean in the form action, when the form is submitted?

    You should never need to use the evaluate function. Try this when the form
    is submitted (this is assuming all of your checkbox names start with prod_ -
    prod_jim, prod_mike, etc..

    <cffloop list="#form.fieldname#" index="fname">
    <cfset productList = "">
    <cfif left(fname, 5) eq "prod_">
    // you know this is a checkbox and can do what you need to do.
    productList = listAppend(productList, form[fname]);
    </cfif>
    </cfloop>
    <cfdump var="#productList#">


    hth,
    --nimer



    "johnnyred" <webforumsusermacromedia.com> wrote in message
    news:cv0ilv$hsj$1forums.macromedia.com...
    >I am trying to duplicate something I did in HTML. A company selects any
    >number
    > of categories it feels are appropriate for itself. The looped values are
    > submitted to a 2 column table (CompanyNumber,productID). I know how to
    > do
    > this if all the checkbox names are the same, I am having trouble with the
    > names
    > being different. Would I evaluate the variable (evaluate (ProductID &amp;
    > i))?
    > Thanks.
    >

    Mike Nimer Guest

Similar Threads

  1. Checkboxes with the same name in Flash forms
    By pope on acid in forum Coldfusion Flash Integration
    Replies: 0
    Last Post: July 16th, 07:54 AM
  2. Checkboxes keep selected data but show all choices inupdate form
    By tharring in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: February 22nd, 05:12 PM
  3. Replies: 1
    Last Post: February 22nd, 12:29 AM
  4. flash form: how to align form controls in table manner
    By jshaffner in forum Macromedia ColdFusion
    Replies: 3
    Last Post: February 18th, 07:35 PM
  5. adding checkboxes in a form
    By marc in forum Microsoft Access
    Replies: 0
    Last Post: July 31st, 12:18 AM

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