• Resolved miketica

    (@miketica)


    Hi,
    I know that this has been covered in couple of topics already. However, I could use some help with passing values from one contact 7 form to another:

    Let’s say you have page 1 with a form that collects just the email address from a prospect and we need to pass that value and prepopulate another longer form located on page 2.

    Can you please help me out, and others that will have this question in the future, with a step by step example on how to implement this? Such as syntax, how to pass the values from page 1 to page 2, how to match the fields and prepopulate the second field, etc

    I have read couple of similar topics, but haven’t found the syntax for the short form on page 1 and the article that I found on passing values to another page is written by Contact Form 7 and I am not sure it is complete for the purpose described here.

    My point is that it would be very nice to have it all in one place.

    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Author sevenspark

    (@sevenspark)

    Hi miketica,

    I really recommend you read through how HTML forms work, as once you have that foundation, this will all be very simple. But here’s the basic idea:

    A form’s purpose is to submit a set of values to a URL. The input names and their associated values will be submitted to the action URL as POST or GET variables.

    Before we go any further, you really wouldn’t submit a CF7 form to a CF7 form. You’d submit a normal (non-CF7) form to a page with a CF7 form.

    So on mysite.com/home, you have a simple form:

    <form action="contact" method="get">
      <input type="email" name="email" />
      <input type="submit" value="Submit" />
    </form>

    When the form is submitted, the page will redirect to

    mysite.com/[email protected]

    Then on the mysite.com/contact page you have a CF7 form

    For your Email input you use a dynamictext tag

    [dynamictext email "CF7_GET key='email'"]

    This fills the email text input with the value of the GET variable with the key ’email’

    Forms submit values to URLs. The CF7_GET shortcode lets you return those values based on a key. The CF7 DTX plugin allows you to use shortcodes to define default values. That’s all there is too it.

    Hope that helps!

    • This reply was modified 7 years, 8 months ago by sevenspark.
Viewing 1 replies (of 1 total)
  • The topic ‘Pass Values From One Form To Another’ is closed to new replies.