Dynamic Checkboxes in Rich Forms

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Dynamic Checkboxes in Rich Forms

    Hi, I am just in the process of working with rich forms in CF MX7. I am trying
    to display checkboxes created from a query. The form is displayed, however, the
    check box labels are all being set to the first record in the database. Please
    could someone tell me how to get the correct labels to be displayed? See the
    code below:

    <cfquery name="GetCert" datasource="#application.dsn#">
    select * from Certifications
    order by CertName
    </cfquery>

    <html>
    <head>
    <title></title>

    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <cfform action="staffcert2.cfm" method="post" format="Flash" height="400">
    <cfformgroup type="repeater" query="GetCert">
    <cfinput type="checkbox" name="Certified"
    bind="{GetCert.CertID[GetCert.CurrentRow]}"
    label="#GetCert.CertName[GetCert.CurrentRow]#">
    </cfformgroup>
    <cfinput type="submit" value="Select" name="Submit" />
    </cfform>
    </body>
    </html>

    Cranners Guest

  2. Similar Questions and Discussions

    1. Dynamic Checkboxes
      This is a rather simple situation that is killing my brain, maybe because I'm working on a Sunday night?! Anyhow, I am running a query against my...
    2. Checkboxes with the same name in Flash forms
      This works fine until you add format="flash". Can anyone tell me how to get this works in a flash form, please? <cfform format="flash">...
    3. Rich flash forms and validation functions
      Hi. I used to use the following to validate my forms: <!--- init form feilds ---> <cfparam name='form.FirstName' default=''> <cfparam...
    4. Multiple choice checkboxes in PDF forms
      Hi, I tried searching on this and couldn't find anything! I want to be able to add a checkbox with 3 states, (blank, ticked and crossed). ...
    5. Dynamic checkboxes and INSERT into DB
      "Frank Collins" <fcollins@mhca.com> wrote in message news:094101c352a8$7ca66990$a401280a@phx.gbl... Hmm..so you get your companyID on the same...
  3. #2

    Default Re: Dynamic Checkboxes in Rich Forms

    2 problems you are trying to bind the value with client side markup {}
    (processed on the client) and the labels with server size ## (processed by CF)
    if you want to use cfloop to loop over the checkboxes, then you want the server
    side version. However, if you are using the repeator cfformgroup then you are
    processing the loop on hte client and need to use the client side version. try
    this <cfformgroup type='repeater' query='GetCert'> <cfinput type='checkbox'
    name='Certified' value='{GetCert.currentItem.CertID}'
    label='{GetCert.currentItem.CertID}'> </cfformgroup> One bit of caution, the
    column names are case-sensitive. So you need to make sure the CertID column, is
    the same as column case in your db? or in the SQL? hth, ---nimer

    nimer Guest

  4. #3

    Default Re: Dynamic Checkboxes in Rich Forms

    Hi, Thanks, that worked. I tried using server side ## with CFLOOP but that
    just gave me a blank form, no content. I changed my code to:

    <cfloop query="GetCert">
    <cfinput type="checkbox" name="Certified" value="#GetCert.CertID#"
    label="#GetCert.CertID#"><br>
    </cfloop>

    Cranners Guest

  5. #4

    Default Re: Dynamic Checkboxes in Rich Forms

    I tried using the same code format with the repeater for checkboxes. The form displays fine, but all the checkboxes are checked when the form first displays...any ideas?

    thanks...
    johnnyred Guest

  6. #5

    Default Re: Dynamic Checkboxes in Rich Forms

    From what I've read it looks like you have to use a checked='false' parameter with CFINPUT
    Cranners Guest

  7. #6

    Default Re: Dynamic Checkboxes in Rich Forms

    Yes, I tried that. But the checkboxes are still pre-checked. Odd.
    johnnyred Guest

  8. #7

    Default Re: Dynamic Checkboxes in Rich Forms

    This is a known bug, when using the repeator.

    ---nimer


    "johnnyred" <webforumsuser@macromedia.com> wrote in message
    news:cvij6m$ad9$1@forums.macromedia.com...
    > Yes, I tried that. But the checkboxes are still pre-checked. Odd.

    Mike Nimer Guest

  9. #8

    Default Re: Dynamic Checkboxes in Rich Forms

    Well, that explains that...I will move onto something else.

    Thanks.
    johnnyred Guest

Posting Permissions

  • You may not post new threads
  • You may 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