WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] using form data after redirect (2 posts)

  1. teunvink
    Member
    Posted 1 year ago #

    After submitting a form I need to redirect to another page to do some additional things based on the submitted data. I found http://contactform7.com/redirecting-to-another-url-after-submissions/ which works. However, I need to have the submitted data in the script handling the page to which the user is redirected. I tried adding the tags from the form as URL parameters ('redirectpage.php?email=[email]') but that doesn't work. Is there any way to solve this?

    http://wordpress.org/extend/plugins/contact-form-7/

  2. teunvink
    Member
    Posted 1 year ago #

    Using the hints in https://wordpress.org/support/topic/adding-custom-variables-to-on_sent_ok-redirect-url?replies=2 I fixed it this way:

    I added an 'id:name' tag to the form field, and in the additional settings I added:

    on_sent_ok: "var name = document.getElementById('name').value; redir='http://example.com/index.php?name='+encodeURIComponent(name); window.location = redir;"

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic