• Hello,

    I am using CF7 with additional settings to force the “location” onsubmit, passing the form parameters with a GET method.

    For single values, this works :
    in CF7 : [select country id:country include_blank ]

    in Additional settings :
    on_submit: "location = 'https://example.com/page.html/?country=' + document.getElementById('country').value;"

    This work. Now how can I get the on_submit to send multiple select values :
    in CF7 : [select country id:country multiple include_blank ]

    What should I put in the on_submit: ?

    Thanks for the help

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
  • Thread Starter camouyer

    (@camouyer)

    Making some progress on the question above .

    Using jquery and the join function, I am able to get multiple values :
    on_submit: "location = 'https://example.com/page.html/?country=' + $( "#country" ).val().join(";");"

    BUT, if nothing is selected, then there is an error :
    Uncaught TypeError: Cannot read property ‘join’ of null

    What should I change ? so that the on_submit works with 0, 1 or multiple selected values ?

Viewing 1 replies (of 1 total)
  • The topic ‘Additional settings on_submit:location and multiple select’ is closed to new replies.