ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 21st, 2005, 11:09 AM
fraumeni fraumeni is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 9 fraumeni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 55 m 55 sec
Reputation Power: 0
PreserveData CFINPUT TYPE=checkbox ColdFusion 7 Bug? (Checkboxes always checked)

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.

Below 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


[code]
<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>
[code]

Last edited by fraumeni : June 23rd, 2005 at 11:54 AM. Reason: added example code

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > PreserveData CFINPUT TYPE=checkbox ColdFusion 7 Bug? (Checkboxes always checked)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT