Ask a Question related to Macromedia ColdFusion, Design and Development.
-
fraumeni #1
Checkboxes Always Checked in ColdFusion 7 when usingPreserveData
There seems to be a bug in how preserveData is handling checkboxes. I have
noticed that if CFFORM.preserveData is set to True and
FORM.SomeCheckBoxGroupName is defined, all checkboxes in the
SomeCheckBoxGroupName group are checked, even if it is set to the empty string.
The one exception to this is if there is only one checkbox in the name group.
This means both that all checkboxes in SomeCheckBoxGroupName are checked
whether data is posted to a form with checkbox group SomeCheckBoxGroupName in
it or if CFPARAM or the like is used to initialize FORM.SomeCheckBoxGroupName
to anything.
Has anyone else encountered this or has possible fixes/workarounds? We
specifically need to be able to post from a form to itself and have the
filled-in data still filled-in (not a problem save with the checkboxes).
This was not the case in ColdFusion 6.1 (using the same code) and I can't find
a woraround given the change in ColdFusion MX where the CHECKed attribute is
ignored if preserveData is set to True.
Attached is a simple example with two checkboxes and preserveData set to True.
If you check neither of the checkboxes and Submit the form, they remain
un-checked, but if you check either of the two, both become checked, even
though the checkbox variable only shows one having been checked.
Thanks very much.
James Fraumeni
<h3>cfform Example</h3>
<!--- If Form.oncethrough exists, the form has been submitted. --->
<cfif IsDefined("Form.oncethrough")>
<h3>Posted to self</h3>
</cfif>
<cfform name="cfformexample" preservedata="True" method="POST">
<h4>This example displays checkbox input type for cfinput.</h4>
Checkbox FORM variable is:
<cfif IsDefined("Form.chkTest2")>
<cfoutput>#FORM.ChkTest2#</cfoutput>
<cfelse>NOT DEFINED</cfif> <BR>
Yes <cfinput type = "Checkbox" name = "ChkTest2" value = "Yes"><BR>
Mebbe <cfinput type = "Checkbox" name = "ChkTest2" value = "Mebbe"><BR>
<p><cfinput type = "submit" name = "submit" value = "show me the result">
<cfinput type = "hidden" name = "oncethrough" value = "Yes"></p>
</cfform>
fraumeni Guest
-
CheckBoxes in DataGrids-- the "checked" attribute not correct after posting page?
Hi everyone, I'm using a DataGrid with TemplateColumns. My DataGrid is located in a cell of an asp:Table. I did this so it's positioned... -
How do I loop through checkboxes and set them as Checked?
I have a Datagrid where there is a Checkbox in the Header. When the user clicks on this checkbox, I want all the checkboxes in each row to show as... -
how to display checked checkboxes from comma separatedlist?
I have a conference registration page that displays information from a database: -Membership info comes from a members table. -Conference info... -
Template - checked out but not showing as checked out.
I have a template that points to folders in our secure folder. I try to make a change to the template and say to update the files and it says... -
Checkboxes in fillable PDF don't stay checked
I am creating an evaluation form in fillable PDF. There are a series of questions, then five checkboxes next to five ratings (superior excellent good...



Reply With Quote

