Thanks Michael, that works! I'm talking about using the new CFMX7
CFFORM structures. In fact I'm using the XML forms.
Here's how I can code the same options I had earlier, now using Michael's
delayed evaluate technique,
<cfformgroup type="horizontal" label="Preferred Payment Method:">
<cfinput type="radio" name="PaymentMethod" value="Visa" Label="Visa"
checked="#iif(order.getpaymentmethod() IS
'Visa',de('true'),de('false'))#" >
<cfinput type="radio" name="PaymentMethod" value="Mastercard"
Label="Mastercard"
checked="#iif(order.getpaymentmethod() IS
'Mastercard',de('true'),de('false'))#" >
<cfinput type="radio" name="PaymentMethod" value="Amex" Label="Amex"
checked="#iif(order.getpaymentmethod() IS
'Amex',de('true'),de('false'))#" >
</cfformgroup>
Now it's all in 5 lines of code instead of 15 lines, and the range of
options is listed only once. In a set of radio buttons where there are for
example 20 choices, this would make a huge difference to the amount of work,
typing, coding and future maintenance.
Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month
On 3/20/06, Michael Traher <[EMAIL PROTECTED]> wrote:
>
> You could use #iif(order.getpaymentmethod() IS
> 'VISA',de('checked'),de(''))#
> in the checked attribute value.
>
> Not quite what you meant I know but would be neater than lots of
> <cfif><cfelse> constructs.
>
> HTH
> --
> Mike T
> Blog http://www.socialpoints.com/
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235730
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54