Skip to main content
February 20, 2013
Question

cfinput checkbox labels

  • February 20, 2013
  • 1 reply
  • 1325 views

Dear reader,

I work with Coldfusion 8 and have a form that is type XML .

When I create this code:

<cfinput label="Sox" name="Sox" type="checkbox" checked="#YesNoFormat(qCompanyControl.Sox)#">

<cfinput label="Tax" name="Sox" type="checkbox" checked="#YesNoFormat(qCompanyControl.Tax)#">

<cfinput label="Iso" name="Sox" type="checkbox" checked="#YesNoFormat(qCompanyControl.Iso)#">

3 checkboxes with THE SAME NAME.

the result on screen is what I want, but the problem is now that I cannot access all 3 seperate...

When I change my code to the code is should be:

<cfinput label="Sox" name="Sox" type="checkbox" checked="#YesNoFormat(qCompanyControl.Sox)#">

<cfinput label="Tax" name="Tax" type="checkbox" checked="#YesNoFormat(qCompanyControl.Tax)#">

<cfinput label="Iso" name="Iso" type="checkbox" checked="#YesNoFormat(qCompanyControl.Iso)#">

the result is this:

The labels are gone...

What is causing this prolem??  (I tried a lot of things, but apparently not the correct one...

Very curious about this one!

    This topic has been closed for replies.

    1 reply

    February 21, 2013

    Have you tried using cfif around the checked area? For example.

    Sox:<cfinput label="Sox" name="Sox" type="checkbox"<cfif qCompanyControl EQ 'Sox'> checked="Yes"</cfif>>

    Tax:<cfinput label="Tax" name="Tax" type="checkbox"<cfif qCompanyControl EQ 'Tax'> checked="Yes"</cfif>>

    Iso:<cfinput label="Iso" name="Iso" type="checkbox"<cfif qCompanyControl EQ 'Iso'> checked="Yes"</cfif>>

    Inspiring
    February 21, 2013

    That won't compile.  You can't nest cf tags like that.