• mufus

    (@mufus)


    I have a Gravity Form with Checkboxes.
    When this form is submitted, each checkbox is posted as its own value (see input_7_* below).

    *** Post (Form) ***
    https://www.example.com/contact/
    Array
    (
        [input_1_3] => Donald
        [input_1_6] => Duck
        [input_4] => email@example.com
        [input_7_1] => Option 1
        [input_7_2] => Option 2
        [input_7_5] => Option 5
        [input_7_7] => Option 7
    )

    This is hard to work with, as you would need to re-define the “3rd-Party Integration Service” settings if you add a new checkbox option.

    For the moment I’ve solved this by using the hooks to modify the data, but perhaps there should be some built-in function for this as I think this might be a common issue?

    What I would like to see, is, instead of mapping…

    input_7_1 -> myoptions
    input_7_2 -> myoptions
    input_7_3 -> myoptions
    input_7_4 -> myoptions
    input_7_5 -> myoptions
    input_7_6 -> myoptions
    input_7_7 -> myoptions

    …making it possible to set up one mapping, such as:
    input_7_* -> myoptions

    Or is there already another implemented solution to this problem I see?

    https://wordpress.org/plugins/forms-3rdparty-integration/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author zaus

    (@zaus)

    Hm…might be able to add regex handling to the mapping, although for non-GF users it’d be “unnecessary” processing, which I try to avoid baking in to the plugin. Or I could alter how submissions are acquired from GF, although I try to avoid making potentially breaking changes for existing users.

    Maybe a late hook on get_submission to manipulate the submission before my plugin does the mapping. Or could make a plugin hooking on filter_post that would duplicate the mapping section with the regex processing.

    As an aside, I originally wrote this plugin for Contact Form 7, which has much less problems with mappings (and particularly your problem) because you have control over how the input name is generated.

    Thread Starter mufus

    (@mufus)

    I agree, the plugin shouldn’t process unnecessary code if not needed.
    What about a checkbox-option for each service, where you can enable regexp processing or not on the mappings?

    With the temporary hook I created now, I had to hard-code the “input_7_*” processing, which isn’t ideal.

    I used CF7 in the beginning, but GF is so much better so I’m not going back to CF7 again 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Gravity Form checkboxes mapping’ is closed to new replies.