The code below works
<cfformgroup type="horizontal">
<cfformitem type="text" width="120">Aquamid</cfformitem>
<cfif qgetinfo.aquamid eq 1>
<cfinput type="Checkbox" name="Aquamid" checked>
<cfelse>
<cfinput type="Checkbox" name="Aquamid">
</cfif>
</cfformgroup>
If you change the checked to checked="checked" it throws the error
displayed below.
Attribute validation error for tag CFINPUT.
The value of the attribute CHECKED is invalid. The value cannot be converted
to a boolean because it is not a simple value.Simple values are booleans,
numbers, strings, and date-time values.
-----Original Message-----
From: Andrew Scott [mailto:[EMAIL PROTECTED]
Sent: Saturday, 12 May 2007 1:56 AM
To: CF-Talk
Subject: Re: Using Checkboxes in cfform
Oh and this is wrong too, but it won't cause an error.
And for an FYI anytime you are outputting a CF variable then you use hashes
with a rare exception on some things. But when in code #'s are not needed so
this
<cfif #qgetinfo.aquamid# eq 1>
<cfinput type="Checkbox" name="Aquamid" checked>
<cfelse>
<cfinput type="Checkbox" name="Aquamid">
</cfif>
becomes
<cfif qgetinfo.aquamid eq 1>
<cfinput type="Checkbox" name="Aquamid"
checked="checked">
<cfelse>
<cfinput type="Checkbox" name="Aquamid">
</cfif>
Or you could
<cfinput type="Checkbox" name="Aquamid" <cfif
qgetinfo.aquamid>checked="checked"</cfif>
>
On 5/12/07, Pete <[EMAIL PROTECTED]> wrote:
>
> Hi All
>
> I am using flash forms for the first time and so far everything seems to
> be
> working OK, well until I got to having to display radio buttons and
> checkboxes.
>
> I am creating a update form where I read in data from an existing table.
>
> Basically I have in the program:
>
> <cfset aquamid=Trim(qgetinfo.aquamid)>
>
> And then I have:
>
> <cfformgroup type="horizontal">
> <cfformitem type="text" width="120">Aquamid</cfformitem>
> <cfif #qgetinfo.aquamid# eq 1>
> <cfinput type="Checkbox" name="Aquamid" checked>
> <cfelse>
> <cfinput type="Checkbox" name="Aquamid">
> </cfif>
> <cfinput type="Checkbox" name="Aquamid" label="Please check
> for Aquamid">
> </cfformgroup>
>
> However this is giving me an error and not displaying the page with the
> checkbox being checked.
>
> I look forward to any replies on how this should be done.
>
> Cheers
>
> Pete
>
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:277817
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4