You do not require IS "true".
You can just use E.g.
<cfinput
type="radio"
name="myName"
<cfif scope.myName>
checked="yes"
</cfif>
>
This is better practice.
-----Original Message-----
From: Clint Stanger [mailto:[EMAIL PROTECTED]
Sent: 10 May 2005 17:56
To: CF-Newbie
Subject: Conditional attributes
Jim,
He's right... you need an if statement inside the input tag. This works
with HTML form controls too. If none of the radio set's values return true
then the first one in that set will be checked. Also, if you have more than
one return true then the last one will be selected. Cause it goes in order.
E.g.
<cfinput
type="radio"
name="myName"
<cfif scope.myName IS 'true'>
checked="yes"
</cfif>
>
>I'm designing a form where I want to have some radio buttons
>preselected based upon the previous screen.
>I'm looping through and generating a list similar to:
>
><li><cfinput type="radio" name="radio#question_seq#"></li>
>
>(where #question_seq# is generated from a database query).
>
>What I want to do is in that list of radio buttons, ad one which will
>have the checked="checked" attribute.
>
>I can't figure out how to do this.
>Can anyone point me in the right direction?
>
>My initial try was to attempt a cfif within the cfinput, but that
>didn't work.
>If any of you are familiar with XSL you can do this with the
>xsl:attribute tag. That's where I'm coming from.
>
>Thanks
>-Jim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Flash for programmers - Flash MX Pro
http://www.houseoffusion.com/banners/view.cfm?bannerid=56
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:908
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54