I am having a small issue with CFv5. The data is getting saved correctly but when I retrieve it for editing the checkbox group data is not populated. All other fields are coming correctly.
Please help.
Regards,
Satyam
One more thing I noticed. If I just save one option in the checkbox group, it is retrieved perfectly. But when saving more than one option, the DB shows the options getting saved but the edit form does not retrieve them.
Any idea where I am going wrong?
Regards,
Satyam
<?php
$form->data["checkboxes_name"] = explode(",", $form->data["checkboxes_name"]);
This code should go into a custom code action after the DB Read action!
Regards,
Max
I tried this also. Echoing $form->data["checkboxes_name"] gives Array ( [0] => Value1 [1] => Value2 [2] => Value3 )
So the data is getting converted back to array. The key and value for the checkboxes is same. Do you think this may be causing some problem?
Regards,
Satyam
If they match the array then the boxes should be republished!
Regards,
Max
Thanx a lot for your help. There was a wrongly placed handle array action which was creating the issue. Your code solved the problem perfectly.
Regards,
Satyam
The field must end with two brackets [] , in V4 they were added by the program.
If the Field name is Test the name in the Checkbox Group is Test[]
It still didn't work when I added them to existing fields, after renaming them and saving the form it worked (when I changed the name back it still worked).
With a Model (in this case Model: Form and Fieldname: Test ) the systax is: Form[Test][]
To save the field in a table:
Put a Handle Arrays in the On Submit before de DB Save.
In the Handle Arrays fill in the fields, in this case: Form.Test (No brackets)
Rob
Regards,
Max
With a large program it is easy to lose track (or make typo's).
For a beginner with Chronoforms (like me) the syntax is not always completely clear.
Rob
Three possible explanations:
+ you have two forms with the same name and the 'wrong' one is displaying
+ you have caching enabled in the site so that the changes aren't showing up until the cache expires
+ you have the form set to Custom Code and changes in the Designer are being ignored (actually I'm not sure this is possible)
Bob
+ you have two forms with the same name and the 'wrong' one is displaying
No.
+ you have caching enabled in the site so that the changes aren't showing up until the cache expires
No. I thought about that and deleted all cache, but the changes do show up, I have changed the name of the respective field and have seen the new name in the source code, but always without the brackets, even though they are set in the designer.
+ you have the form set to Custom Code and changes in the Designer are being ignored (actually I'm not sure this is possible)
No. It's set to Wizard Designer.
By all means PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.
Bob
Thanks for the link - the [] are showing correctly there
<div class="gcore-single-column" id="fclmn">
<div class="gcore-checkbox-item" id="fitem">
<input name="mycbxfield[]" id="mycbxfieldid" class="A" title="" style="" data-load-state="" data-tooltip="" type="checkbox" value="No">
<label class="control-label gcore-label-checkbox" for="mycbxfieldid">No</label>
</div>
<div class="gcore-checkbox-item" id="fitem1">
<input name="mycbxfield[]" id="mycbxfieldid1" class="A" title="" style="" data-load-state="" data-tooltip="" type="checkbox" value="Yes">
<label class="control-label gcore-label-checkbox" for="mycbxfieldid1">Yes</label>
</div>
</div>
Bob
I've lost track of what the problem is here?
The importer tool is not particularly useful, effectively it only imports the form HTML. In general it's better to stick with CFv4 for existing forms, create new ones in CFv5 and migrate the older ones over by re-building as and when they need to be updated.
Bob
FORM_FIRSTNAME=Firstname
to something like that:
[FORM_FIRSTNAME]=Firstname
Hope it helps!
Terry
