- This topic has 7 replies, 2 voices, and was last updated 9 years, 10 months ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
Tagged: field name, format
Hello.
I encountered an issue with checkboxes field.
Example:
Optional course: Opt1 Opt2 Opt3
If I select Opt1 and Opt2 for example, the list item will only record the first option into the DB.
When editing the List Item, php warnings are issued for each existing option:
Warning: in_array() expects parameter 2 to be array, string given in [...] bepro_listings_form_builder.php [...]
This corresponds to the line:
$checked = (in_array($option->label, $the_val))? "checked='checked'":"";
from the checkboxes case of the function build_the_form
Please confirm the bug and a possible fix.
I analyzed the format for checkboxes and changed manually in the DB the entry of a checkbox in the form_values of a List Item, like this:
"gr_limbi_optionale":"Opt1"
"gr_limbi_optionale":["Opt1","Opt2"]
Now the form is rendered correctly when editing the List Item, the proper options are checked correctly.
What’s the name of the function for processing a form submission in the DB?
I guess you have an error processing the post variables immediately after submitting the form – probably javascript.
After submission of the form the post dump shows for what should have been a 3 out of 5 selection:
["gr_limbi_optionale"]=> string(8) "German"
hi,
Thanks for notifying us.
The Form is processed in function “bepro_cart_button” in bepro_listings_form_builder.php on line 457. We will definitely investigate this issue and release a fix
___
BePro Software Team
Hello,
there are no references to bepro_cart_button in the bepro_listings_form_builder.php
Only in bepro_listings_functions.php I found 3 references to triggering that shortcode.
Please let me know if you have any leads on this issue – this is a wall I can not go over.
Hi,
Our apologies, we quoted the right location but wrong function name. The name of the function is “form_builder_save”
However, we doubt that function will help. Our dev team is recommending that you confirm that the checkbox Field Name ends with “[]”. For example, the default Field Name for all checkbox fields added to the Form Builder is “checkboxes[]”.
___
BePro Software Team
Hello.
Yes – that was the problem, the name I have set did not included the enclosed brackets in the field_name.
It is rather intuitive to have them added to the field name post processing of the form.
Thank you for your time and guidance.
Hi,
We are working on ways of warning users of issues like this, which can cause form errors. You can anticipate seeing these improvements in upcoming versions of the Form Builder. We understand that the average person won’t understand the reason for the brackets []; However, our goal is to make it easy for everyone to use.
Thanks again for bringing this to our attention.
___
BePro Software Team
Stay up to date on web design and development trends. Also receive updates on video tutorials, services, deals, products, and discounts offered by the BePro Software Team. to sign-up for our newsletter today.