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...
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!
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>>
Copy link to clipboard
Copied
That won't compile. You can't nest cf tags like that.
Copy link to clipboard
Copied
thanx for help, but unfortunately it didn't work..
any more ideas??
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" />
Copy link to clipboard
Copied
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?