• Resolved llago

    (@llago)


    Hello,
    for a project I am massively using default:shortcode_attr for a huge form. The only problem: seems that in that mode, multiple values are not supported.

    Example:
    I have a multi checkboxes like this:
    [checkbox* your-mood use_label_element default:shortcode_attr]
    This is dinamically populated with values, for example
    [1] => “happy”
    [2] => “sad”
    [3] => “medium”
    [4] => “whatever”

    I CAN set “sad” as default like this [contact-form-7 id="1859" title="My form" your-mood="2"]
    but I CANNOT set multiple values. I tried multiple syntaxes but analyzing the code there is no string split of any kind.
    Those examples that I tried but are NOT working:
    [contact-form-7 id="1859" title="My form" your-mood="2_3"]
    [contact-form-7 id="1859" title="My form" your-mood="2,3"]
    [contact-form-7 id="1859" title="My form" your-mood="2" your-mood="3"]

    Am I missing something?

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

    (@takayukister)

    See Checkboxes, radio buttons, and menus

    You can do it like this:

    [checkbox* your-mood use_label_element default:2_3 "happy" "sad" "medium" "whatever"]

    Thread Starter llago

    (@llago)

    Hi! Thanks for your answer!
    I can’t do it like this, because I’m dinamically generating the shortcode with default values changing based on some computation.
    My work around was to assign a comma separated value to a hidden field, and fill up the checkboxes using JS.

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

The topic ‘default:shortcode_attr and multiple values’ is closed to new replies.