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

cfinput checkbox labels

Guest
Feb 20, 2013 Feb 20, 2013

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!

1.3K
Translate
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

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

Translate
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

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

Translate
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

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

any more ideas??

Translate
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

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

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

Translate
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