• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfinput checkbox labels

Guest
Feb 20, 2013 Feb 20, 2013

Copy link to clipboard

Copied

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...

samename.jpg

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:

UniqueName.jpg

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!

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 21, 2013 Feb 21, 2013

Copy link to clipboard

Copied

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>>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 21, 2013 Feb 21, 2013

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

thanx for help, but unfortunately it didn't work..

any more ideas??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 23, 2013 Feb 23, 2013

Copy link to clipboard

Copied

This doesn't really address your question, but have you considered just using a label tag?  I've always had dubious results with the label attribute of <cfinput>, so I just use the HTML label tag.

<label for="sox">Sox</label>

<cfinput name="sox" id="sox" type="checkbox" />

<label for="tax">Tax</label>

<cfinput name="sox" id="tax" type="checkbox" />

<label for="iso">Iso</label>

<cfinput name="sox" id="iso" type="checkbox" />

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 25, 2013 Feb 25, 2013

Copy link to clipboard

Copied

LATEST

I tried that option, but it doesn't work... maybe this is because the formtype is XML and the label is HTML format? I don't know?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation