Forums

Checking checkboxes when editing?

megana 24 Aug, 2012
Hi there,

When I am editing information in a form, my custom checkboxes are not staying checked like they should. I am using ChronoForms 4.0 RC3.5. Here is an example of one of my checkboxes:

<input type="checkbox" value="2012-09-21" name="lunchdate[]">


And here is my debugger output:

Data Array:

Array
(
    [Itemid] => 328
    [option] => com_chronoconnectivity
    [task] => cc_edit_data
    [cb] => 3
    [cf_id] => 3
    [cf_uid] => 864237e80fffe562b1e5c3f74f50d4f8
    [cf_created] => 2012-08-17 16:48:10
    [cf_modified] => 0000-00-00 00:00:00
    [cf_ipaddress] => 173.161.75.101
    [cf_user_id] => 44
    [lunchdate] => 2012-09-06,2012-09-21
    [name] => Test
)


Even if I go in and manually add checked="checked" on them, they don't stay checked! What's going on?

(Note: the "name" field on my form does fill in properly with the word "Test", so it's not completely broken.)
GreyHead 25 Aug, 2012
Hi megana,

I don't have CFv4 RC3.5 so there may be something different in that version.

I can see the checkbox results in the Debug array so the boxes are staying ticked for practical purposes. I wonder if your template is changing the textbox layout so that they look un-checked.

Bob
megana 27 Aug, 2012
That could be, we purchased this template from somewhere and it has a number of odd behaviors we weren't expecting.

I don't know if this helps, if I manually add checked="checked" to the checkboxes and then go directly to the form as if filling it out new instead of using it to edit info, THEN the boxes stay checked.
GreyHead 27 Aug, 2012
Hi megana,

Please post or PM a link to the form so I can take a quick look.

Bob
GreyHead 27 Aug, 2012
Hi megana,

I think it may be the bug reported in this thread try contacting Max for the fix.

Bob
megana 13 Sep, 2012
Just wanted to let you all know that it was a very simple solution, haha.

From Max: "Open your connection page, go to the "Advanced" tab under "General" and add your checkbox field name in the "Array fields names" field."
This topic is locked and no more replies can be posted.