Tagged: field name, format
- This topic has 7 replies, 2 voices, and was last updated 10 years, 11 months ago by BePro Software Team.
-
AuthorPosts
-
July 1, 2015 at 1:37 pm #6044CosminMember
Hello.
I encountered an issue with checkboxes field.Example:
Optional course: Opt1 Opt2 Opt3If 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_formPlease confirm the bug and a possible fix.
July 1, 2015 at 2:00 pm #6045CosminMemberI 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?July 1, 2015 at 3:10 pm #6046CosminMemberI 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"July 2, 2015 at 6:03 pm #6063BePro Software TeamKeymasterhi,
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 TeamJuly 3, 2015 at 9:05 am #6067CosminMemberHello,
there are no references to bepro_cart_button in the bepro_listings_form_builder.phpOnly 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.July 3, 2015 at 9:35 am #6068BePro Software TeamKeymasterHi,
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 TeamJuly 6, 2015 at 8:55 am #6084CosminMemberHello.
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.
July 6, 2015 at 12:54 pm #6089BePro Software TeamKeymasterHi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.
