• I have my cf7 form to set forward to a thank you page after form submission. On this thank you page, I want to put in another form for the client so they can add more info if they wish. This is vital because the CRM I am using (and importing all of this data into) needs to have a field to match current database entries. The best idea I cna come up with is to add the field data to the url and then have the next form grab the info from the url and populate the necesary field. So the basic question is, Can I add the data from a field to the url address of the thank you page?

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello bcallahan,

    You will find the Additional Settings field in contact form management page. Simply insert the following line into it:

    on_sent_ok: "location = 'https://thankupage_url.com&' + $('form.wpcf7-form').serialize();"

    This will append all the form data as parameters in the query string.

    Thanks

    Thread Starter bcallahan

    (@bcallahan)

    Thanks!!! I really only want one particular field to show but I think I can figure it out from here.

    1.Assign a ID to the input you want to send.
    2.Then change the actual code to this one:

    on_sent_ok: "location = 'https://example.com/other-page/?email=' + jQuery('form.wpcf7-form #assigned_id').val();"

    Original post

    Hi,
    I am sorry, but I am not as experienced as the previous posters, and do not fully understand!

    I would like to display the submitters email address on my success redirect page. To say among other things: “I will reply in a few minutes to this email address:
    If this email address is incorrect, please resend your message, or email me directly at [email protected]

    My success page is: https://www.mysite.com/thank-you
    My form is: [contact-form-7 id=”4001″ title=”Contact Christine”]
    And my email field is called: [email* your-email]

    What do I need to put in the ‘Additional Settings’, and on the Success page, to make this happen?

    Many thanks, Chris

    Hello Chris,

    I am not an expert. But, using your example you can create email field as

    [email* your-email id:senderemail]

    ID is created while you are generating the email tag where it says ID Attribute. Or, you can manually type it in.

    Then, using my sample, you enter

    on_sent_ok: "location = 'https://example.com/other-page/?email=' + jQuery('form.wpcf7-form #senderemail').val();"

    or, just curious

    on_sent_ok: "location = 'https://example.com/other-page/?email=' + $('form.wpcf7-form #senderemail').val();"

    where you change “https://example.com/other-page/?email=” to your redirect page. Once submitted successfully and redirected to a page, you will see that your URL would look something like this:

    https://example.com/other-page/?email=blahblah@shanana{dot}net

    Then, on your redirected page grab ’email’ value by using any programming language.

    For example, in PHP use $emailvar = $_GET[’email’] and then echo $emailvar. To use PHP within a post/page use any plugin that allows PHP in post/page.

    Good luck.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘populate field with data from a form on the previos page.’ is closed to new replies.