Hi,
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
Hi,
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
You may need to convert the data back to an array:
<?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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi 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
What are the original options list in your checkboxes group element ?
If they match the array then the boxes should be republished!
Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi 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 Checkbox Group seems to work slightly different in V5.
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
Thanks Rob, although v5 has few different things, but this is for the good, the brackets are added by default in v5 if you add a new "checkboxes group" element using the designer!
Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
The brackets are added but I keep al my fields an variables etc with a description in a separate file and paste them on the form, so the brackets were gone.
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
Sorry to attach this here, but what you describe doesn't work for me. I use chronoforms5 and even set up my checkbox group again, changed the name of the field and changed it back etc. The brackets are added in the designer but don't appear in the source code, so I only ever receive the last option checked. Has any one solved that issue and knows what I am doing wrong?
Hi bytekultur,
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
Hi Bob, thank you for the quick answer.
+ 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.
Hi bytekultur,
By all means PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.
Bob
Thank you bob, as I mentioned in the private message - it might be a migration issue. Unfortunately, importing cf4 forms into chronoforms5 is not working too smoothly yet. I will have to manually transfer the fields and actions into a new form. Or if you have a better / quicker idea, please let me know! ;-)
Hi bytekultur,
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
Hi Bob, the problem was a checkbox group field which didn't accept [] brackets in the name. The answer to the question why seems to be that the form HTML has been imported from CFv4 which causes strange behaviour compared to a form created directly in CFv5. So the "solution", or a workaround, is for me to set up the form again manualy in CFv5 from scratch, I undestood there is no better way. No further assistance needed, thank you. 😉
Hi Terry,
Thank you - I hadn't seen that particular problem before ;-(
Bob