Skip to main content
MelissaNewlin
Participant
February 8, 2010
Question

CF8 preservedata: all checkboxes checking

  • February 8, 2010
  • 2 replies
  • 536 views

When using cfform's preservedata attribute we're 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.

The official documentation insinuates that's the way it used to behave prior to CFMX, but we're using CF8.0.1 (on Linux 2.6.18). I've Googled up others with this problem but no answers -- there was even a post on these forums in 2008 -- and a couple CF gurus I've contacted said to report it as a bug. I found a reference where Macromedia acknowledged this as a bug for CF7. (http://webdesign.mylounge.com/archive/index.php/t-257235.html)

Here's a simple example form (with the code printed out underneath): http://www.cadetesting.com/preservedata.cfm. Can you catch anything wrong with the way it's coded that others missed? Or is this truly a bug on our server?

    This topic has been closed for replies.

    2 replies

    Inspiring
    February 8, 2010

    I cannot say I use the feature. But based on the results, and the fact that it was already acknowledged as a bug by Macromedia... I would say it is a bug. At the very least, counterintuitive behavior.  Check the bug database. If it is not already there, submit a report.  You may want to include the link mentioning the old macromedia bug number.

    http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html

    Inspiring
    February 8, 2010

    I've never used preserveData but reading the description on it I am not sure it works for checkboxes

    When the cfform action attribute posts back to the page that contains the form, this attribute determines whether to override the control values with the submitted values.

    • no: uses values specified in the control tag attributes.
    • yes: uses corresponding submitted values.

    Applies to these controls:

    • cfinput, cfslider, cftextinput: overrides the value attribute value.
    • cfselect controls that are populated from queries: overrides the selected attribute. See cfselect.
    • cftree controls: overrides the cftreeitem expand attribute. If yes, expands previously-selected elements. The cftree completePath attribute must be set to yes.
    • cfgrid controls: has no effect. (This avoids confusion as to whether data has been resubmitted to the database by the control.)