PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to send parameters from one form to another?

  1. bearclaws
    Member

    I have a form on my homepage that captures a user's ZIP CODE. When submitted, the form directs the user to a new page with a receiving form (containing more fields).

    I want to dynamically populate the ZIP in the receiving form using the ZIP entered in the homepage form. How can I do this?

    The receiving form field is populated when I enter a querystring:
    /my-receiving-form/?zip-code=12345

    ...but it does not populate when I post data from the homepage form.

    Any ideas?

    Posted 14 years ago on Wednesday April 14, 2010 | Permalink
  2. Passing data to a form only works if you have turned the ability on for the individual fields. If you haven't done that, here is what you need to do.

    On the receiving form:

    - Edit the field containing the zip code (might be standalone or an address field)
    - Go to the Advanced tab
    - Check the "Allow field to be populated dynamically" checkbox
    - Give the zip code box a parameter name (ex. zipcode, zip-code, etc.)
    - Save the form

    The parameter is what you pass in the query string as you mentioned in your post above.

    On the sending form:

    - Edit the form settings
    - Go to the Confirmation tab
    - Choose Redirect from the available Confirmation options
    - Enter the URL to the Receiving form (ex. /my-receiving-form)
    - Click the Pass Field Data Via Query String checkbox
    - Build your querystring in the provided box. To insert a form field value use the included "Insert form field" drop down which will output a field variable token.

    Don't include the initial ? mark. So for example it might look something like this in the query string box if you used a parameter called zipcode and a field variable for a zipcode field on an address box:

    zipcode={Address (Zip / Postal Code):1.5}

    - Save the form

    Please note the query string example I used won't work exactly as I have displayed it as the form field variable for the zipcode itself will vary from form to form.

    If the above doesn't work we would need a WordPress admin login to the site so we can take a look and see what is going on. You can send this to us via our Contact Us form and reference this forum thread.

    Posted 14 years ago on Wednesday April 14, 2010 | Permalink
  3. bearclaws
    Member

    This worked perfectly!

    This was the feature I was missing: Pass Field Data Via Query String

    Thank you very much :)

    Posted 14 years ago on Wednesday April 14, 2010 | Permalink
  4. I think I've followed all the directions here but it's not working, the sending form redirects to this - http://www.indonesiamatters.com/book-flight/?name=test+4&email=test%40yahoo.com which is 404.

    In sending form which is here http://www.indonesiamatters.com/flights-faq/ I'm using Redirect as http://www.indonesiamatters.com/book-flight/ and with Pass Field Data Via Query String checked, and this in the box:

    name={Your Name:1}&email={Your Email:2}

    On receiving form I've defined 2 fields with 'name' and 'email'.

    Posted 13 years ago on Thursday May 27, 2010 | Permalink
  5. Try using different query string parameters. "name" is a reserved parameter within WordPress that can't be used. It will return a 404.

    Go to that url and remove the name parameter and you will see that email works. See:

    http://www.indonesiamatters.com/book-flight/?email=test%40yahoo.com

    What you will have to do is use a different parameter name other than "name". Maybe "yourname" instead.

    Posted 13 years ago on Thursday May 27, 2010 | Permalink
  6. thankyou

    Posted 13 years ago on Thursday May 27, 2010 | Permalink

This topic has been resolved and has been closed to new replies.