One follow-up question on this:

For text fields and radio buttons it works like a charm, but I'm having a 
problem with checkboxes. If no items in a group are selected, no items are 
selected when the page reloads. If any items are selected, ALL items in the 
group are selected when the page reloads.

A Google search turned up a few people asking about this same issue but there 
weren't any real answers. The official documentation states, "ColdFusion MX: 
Changed the cfform tag preserveData attribute behavior: if it is set to True, 
ColdFusion checks radio and check box values only if their value matches the 
posted value for the control. (In earlier releases, if the posted value did not 
match any of the cfinput check boxes or radio buttons for the control, the 
checked attribute was used.)" It seems that's the way it USED to behave, but 
we're using CF8.

Any idea what I might be doing wrong? Here's the code for my quick-and-ugly 
form:

<cfform action="" preservedata="yes">
<cfinput name="texty" type="text" id="texty" /><br />
<cfinput type="radio" name="1" id="radio" value="yes" />Yes
<cfinput type="radio" name="1" id="radio" value="no" />No<br />
<cfinput name="thisisacheckbox" type="checkbox" value="indeed" />Indeed
<cfinput name="thisisacheckbox" type="checkbox" value="of course" />Of Course
<cfinput name="thisisacheckbox" type="checkbox" value="obviously" 
/>Obviously<br />
<cfinput name="submit" type="submit" />
</cfform>


>The easiest way with more modern versions of ColdFusion is to use the CFFORM
>tag (in place of the standard HTML form tag) and specify the
>preservedata="yes" attribute.  Likewise, use the ColdFusion input tags such
>as CFINPUT in place of the HTML input tag, etc.  ColdFusion will keep track
>of the form variables and pre-fill the form values for you when the page is
>re-generated.
>
>
>-Justin 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4947
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to