• Resolved mrdanx

    (@mrdanx)


    Hello.

    I’m having an issue between ACF and Forminator for post data containing checkboxes and multiselects. When submitting my form I want to find the data sent in the created project (in the dashboard).

    This works for most of my fields except for checkboxes and multiselects. If I check a single box in the checkbox, if I only choose a single option (for multiselect) then my box is checked and the value of the select goes up well.

    On the other hand, if I check several boxes and if I choose several values ??in the select, then I no longer have my values ??selected.

    Can you help me see this more clearly please?

    Regards..

    • This topic was modified 3 months, 1 week ago by mrdanx.
    • This topic was modified 3 months, 1 week ago by mrdanx.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @mrdanx

    I hope you’re well today!

    This is related to ACF actually rather than Forminator. WordPress itself does not enforce any data format for custom fields and for some types of fields ACF stores data in specific format instead of just plain text. Forminator doesn’t have any built-in ACF-specific integration and it only passes raw plain text data to custom fields which results in incompatibility in such cases.

    That being said, I’m assuming that you are using “postdata” field on the form, with form fields mapped to custom fields, right?

    If so, you can try this custom code snippet:

    https://gist.github.com/adczk/68db359343f68533d8df184b6ccccec7

    To use it you’d need to add it to the site as a Must Use plugin:

    – create an empty file with a .php extension (e.g. “forminator-acf-checkboxes.php”)
    – and place it in the “/wp-content/mu-plugins” folder of your site’s WordPress install
    – copy shared code and paste it into that file
    – save the file.

    Additionally, in this line of the code

    $checkboxes = array( 'check' ); // list of ACF checkbox fields to be made compatible

    you need to list (comma separated) names of your ACF checkbox fields. You’d need to use “field name” (as set in ACF field configuration) and not field labels.

    Best regards,
    Adam

    Thread Starter mrdanx

    (@mrdanx)

    Hi Adam.

    It works perfectly well!

    Thank you so much.

    Best regards,

    Dan

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