Viewing 6 replies - 1 through 6 (of 6 total)
  • domokun

    (@domokun)

    You can pass Form inputs so presumable you can add these to a URL.

    This is how you can pass inputs:

    on_sent_ok: "var name = $('.wpcf7 input[name=your-name]').val();var email = $('.wpcf7 input[name=your-email]').val();$('.wpcf7').hide();$('.entry-title').html('Thank you');$('.entry-content').html(''+name+' : someone from our office will get in touch with you via '+email+' within 24 hours.');"

    And this is how you can redirect to a new URL

    on_sent_ok: "location.replace('https://example.com/thank-you');"

    A good write-up on using both is here: https://www.brianballa.com/contact-form-7-thank-you-success-messages

    Thread Starter Dani

    (@danicasati)

    Thank you for response, but form input should be a part of the redirect URL, not only for generate a custom strings.

    So, text boxes values should be collected to redirect a user to a customized URL.
    Is this possible?

    domokun

    (@domokun)

    Does this work?

    on_sent_ok: “var email = $(‘.wpcf7 input[name=your-email]’).val();location.replace(‘https://example.com/thank-you?e=’+email+”);”

    Thread Starter Dani

    (@danicasati)

    Yes, domoku.
    It works.

    Thank you.
    Just a little problem to read dropdown values if I use this field with pipes: I can read selected item value, but not pipe value.

    Hey Domokun,

    I have my on_sent ok to go to Paypal. Will it be possible to validate input field value (eg >2300) and then I want to re-direct to a different url instead of going to the paypal web site.

    Please advice
    Thanks
    Jacob

    Hey danicasati,

    Can you please let me know how to use the value of a dropdown input in the custom url

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Redirect URL based on inputs’ is closed to new replies.