Tagged: field name, format

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #6044
    Cosmin
    Member

    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.

    #6045
    Cosmin
    Member

    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?

    #6046
    Cosmin
    Member

    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"

    #6063

    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

    #6067
    Cosmin
    Member

    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.

    #6068

    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

    #6084
    Cosmin
    Member

    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.

    #6089

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.