Skip to main content
Inspiring
July 23, 2010
Question

Bind on multiple cfinput checkboxes

  • July 23, 2010
  • 1 reply
  • 1520 views

I'm trying to do something like this but it seems to not be working...

<cfinput type="checkbox" name="checkbox1" value="Yes"> Yes

<cfinput type="checkbox" name="checkbox1" value="No"> No

<cfinput type="checkbox" name="checkbox2" value="Yes"> Yes

<cfinput type="checkbox" name="checkbox2" value="No"> No

<cfinput type="checkbox" name="checkbox3" value="Yes"> Yes

<cfinput type="checkbox" name="checkbox3" value="No"> No

<cfdiv bind=url:qFile.cfm?field1={checkbox1@click}&field2={checkbox2@click}&field3={checkbox3@click} />

My only problem is, it updates when I use the first checkbox... but when I try the second and third checkboxes nothing happens until I change the first checkbox.  How can I get the second and third checkboxes to trigger as well?

Am I missing something?

    This topic has been closed for replies.

    1 reply

    Inspiring
    July 27, 2010

    I get the same results.  It seems like a possible bug. You might try refreshing the cfdiv with ColdFusion.navigate instead, as suggested here.

    http://objectmix.com/cold-fusion/505908-cfdiv-refreshes-binding-radio-buttons.html

    On a side note, radio buttons might be more appropriate for yes/no options. Not that those work either here ... ;-)  But they would seem more intuitive.

    KevlarAuthor
    Inspiring
    July 27, 2010

    Thanks for the link... I will check it out.

    As for the checkboxes ... I just used those for the example, the checkboxes are actually 5-10 different options that the user can have multiple selections.  I was going to use a <cfselect> instead but users had a hard time figuring out how to do multiple selections by holding down the control key.

    Users...

    Inspiring
    July 27, 2010
    I was going to use a <cfselect> instead but users had a hard time figuring out how to do multiple selections by holding down the control key.

    Users...

    Where have they been for the last 10 years ?  ;-) What is funny is the code would probably work with a cfselect.  Too bad you cannot tell them if you want "xyz" feature, you will have to learn to use the control key ... Ah, well. We can dream ...