> I want to make a CFINPUT Radio button checked or unchecked
> depending on the value of a variable from the database.
> Simple right?
>
> Yup..I thought so too.
>
> So why doesn't it work?
>
> <cfinput type="Radio" name="sex" value="Male" <cfif #GEC.Sex#
> eq "Male"> CHECKED = "TRUE" </CFIF> >
>
> I get this error ...
>
> Any ideas on what I'm doing wrong? I expect it to be some
> simple syntax error.
As Matt points out, you can't nest one CF tag directly within another CF
tag.
The easiest solution in this case would be to simply use the HTML INPUT tag,
instead of the CFML tag CFINPUT, which provides extra functionality which
you don't seem to be using anyway. Alternatively, if you want to use
CFINPUT, you could use the inline if function, which lets you convert your
tag-based condition into an expression:
<cfinput type="radio" name="sex" value="male" checked="#IIf(gec.sex eq
"male", DE("true"), DE("false"))#">
Personally, though, I'd just use the HTML INPUT. CFINPUT doesn't seem to add
any useful functionality to radio buttons and checkboxes, in my opinion.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists