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.

Passing form data from one form to another

  1. Hello, so I looked around for a while on the forums and I haven't quite seen someone asking about my current issue.

    Basically I have a form on the homepage of my site that is just collecting an email field. Once the user hits the join us button I want the button to redirect them to a join us page that will have the full join us form and populate the email field.

    The site is not live so I cannot link to it, and I was given this snippet of code.

    add_filter('query_vars', 'parameter_queryvars' );
    function parameter_queryvars( $qvars ) {
            $qvars[] = 'emailsignup';
            return $qvars;
    }
    
    add_filter("gform_pre_render_7", "populate_email");
    function populate_email($form_meta) {
        $form_meta["emailsignup"] = $_GET["emailsignup"];
        return $form_meta;
    }

    I slightly understand the populate function, I just don't understand where we name the field "emailsignup". The queryvars function I am totally lost on and don't really understand how to send that data in the first place. I'm assuming it is something that I must edit in the gui portion of gravity forms but I am not sure what. Any help would be much appreciated, thanks.

    Posted 13 years ago on Monday November 29, 2010 | Permalink
  2. No need to use hooks and code for this, you can use the querystring to do what you need.

    To do this you will need to Setup Form 1 so that it's confirmation is a redirect to the page containing Form 2. Choose the URL Redirect and type the full path to the page containing Form 2 and then use the query string builder to pass email={email field value} so that it redirects to the page containing Form 2 and passes the value of the email field in the query string.

    On Form 2 you would edit the Email field, selected the Advanced tab and choose the option to enable the field to be populated dynamically. For the parameter name you would use "email" (without the quotes).

    Now when you link to the page containing form 2 and pass ?email=the@email.com in the query string it should pre-populate that email field. If you setup Form 2 properly it will do this as it's confirmation redirect.

    Posted 13 years ago on Monday November 29, 2010 | Permalink
  3. This was very helpful thank you. I didn't know it would be so easy and without any coding. Very impressive plugin you have here.

    Posted 13 years ago on Tuesday November 30, 2010 | Permalink
  4. Carl,

    I think I need your help too. What I'm trying to do is quite similar but it requires passing 6 data.

    Our clients will pick 6 cards under the Sales Issue picker here
    http://whatareyoudealingwith.com/questionnaires/sales-builder-virtual-card/

    We need to pass those 6 data to this page. I just added 3 fields for now.
    http://whatareyoudealingwith.com/sales-builder-discovery/

    Please be a bit specific on exactly what codes I should put and in which field. I am not a programmer. I really appreciate all your help. Thank you!

    Shell

    Posted 13 years ago on Wednesday December 15, 2010 | Permalink
  5. Btw, do you know how much the new gravity form (with multi-page) will be? We need the functionality really soon and I'm not sure whether the price variance (vs developer) is huge or not that it is worth the wait. Thanks

    Posted 13 years ago on Wednesday December 15, 2010 | Permalink
  6. @SheilaZaldivar You would do exactly what I described above with the instructions on how to do it with the email field only you would do the same thing for each of the fields you want to do this with.

    Multi-Page will be a free upgrade for all Gravity Forms license holders. It's part of the 1.5 release. You can actually download the 1.5 release now on the Downloads page if you want to manually install it. It's a release candidate which means it's still a test version, but it is stable and usable.

    Posted 13 years ago on Wednesday December 15, 2010 | Permalink
  7. How about if the data is not included in the form. I know that I can pass the data via query string but I want to include one content of the page in the query string that not included in the form?.. is it possible?

    Posted 12 years ago on Monday December 5, 2011 | Permalink
  8. Please provide a brief example of what you're trying to accomplish and we will try to help. Thank you.

    Posted 12 years ago on Monday December 5, 2011 | Permalink
  9. http://tradephonein.com/evaluate-you-device/?phone=IPhone4s , the form is created using gravity form, but the image is not included in the form I just displayed that because I pulled out the image form the database using this statement. "display image where phone = phonemodel", phone model is the iPhone4s.

    you'll see that I have phone=IPhone4s on my query string that's why i was able to display the image. Because of my desire to pass the data of my form into the next page I used the "Pass Field Data Via Query String (?)" I thought phone=IPhone4s will remain in the query string but I was wrong, it's not absolutely missing. Now how can I include phone=IPhone4s on gravity's passing data field. Do I need to code it? but how?

    Posted 12 years ago on Monday December 5, 2011 | Permalink
  10. I see that query string. But I do not understand what you want it to do. Is there a field on this form that should be pre-populated, but is not? Or do you want to use that value on the next page or form or something? I see what you have but am unclear what you mean for it to do.

    Posted 12 years ago on Monday December 5, 2011 | Permalink
  11. yeah, I want to use that value on the next form that's why I want to include it on the query string..

    Posted 12 years ago on Monday December 5, 2011 | Permalink
  12. I added this one on the "Pass Field Data Via Query String"
    phone={phone}
    but it doesn't work it displays as exactly as that.

    PHP code is not allow on that area(Pass Field Data Via Query String) right?

    Posted 12 years ago on Tuesday December 6, 2011 | Permalink
  13. I clicked through and I see this at the end of the query string now:

    &phone=phone

    I think you want that to say:

    phone=iPhone4s

    Correct?

    I think you want this as part of your merge tag:

    phone={phone:value}

    or possibly:

    phone={phone:admin}

    depending on how you configured your form.

    Documentation: http://www.gravityhelp.com/documentation/page/Merge_Tags

    If I misunderstood, I apologize and will try again.

    Posted 12 years ago on Tuesday December 6, 2011 | Permalink
  14. Found a bug during redirection:

    if the url runs on a port other than port 80, say port 8080, the during redirection from one form to another form the port number is skipped.

    say from http://abc.com:8080/page1 we need redirection to http://abc.com:8080/page2 then this will fail !!!! it by default redirects to http://abc.com/page2.....although we pointed it to the correct page...

    IS THIS A BUG ? I THINK SO ...or maybe I am missing some other configuration items...?

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  15. Please help me, I am having a problem or misunderstanding the CONDITIONAL LOGIC for drop down menu list.

    I have 10 drop down list with a question on them each question it leads your to another question, but for now lets just say i have 4 drop down list. and when you finish answering all the question the submit button will show.

    The problem i am facing is when i select (Q1, Q2, Q3, Q4 fields) and decided to change the Q1) to (Q2) my old selection still show below the (Q2).

    I have to go back to the (Q!( to deselect them all to hide them witch can be confusing for my visitors and always the last field show, so here is what i did on the conditional logic i added a extra rules on each question saying ( on the conditional logic Show this field if all of the following match: WHICH SERVICE DO YOU REQUIRE? | IS NOT |

    and also when ever i deselect the field to the main one the last question always show it does not hide?

    ---Example -------------

    lets say i have 5 questions i would like to ask my visitors.

    WHICH SERVICE DO YOU REQUIRE??
    - QUESTION (1)
    - QUESTION (2)
    - QUESTION (3)
    - QUESTION (4)
    - QUESTION (5)

    Now if the visitor select the QUESTION (1) field another drop down list will drop.

    Q2)
    - EMERGENCY
    - QUESTION (1)
    - QUESTION (2)
    - QUESTION (3)

    If they click on QUESTION (2) another drop down field will drop

    Q3)

    - QUESTION (1)
    - QUESTION (2)
    - QUESTION (3)
    - QUESTION (4)
    - QUESTION (5)
    - QUESTION (6)
    - QUESTION (7)
    - QUESTION (8)

    Last question if the user select QUESTION (7) a body text field will show
    and they can add they note

    Q4) add note or request call back

    They is still a problem if u go back to (Q1) on the main drop down menu list all the field you have select are there, even if you decided to go for question (2) and went back to question (1) the prev fields show why is that?

    I haven't sleep for 24 hours trying to understand this rules and how i can fix this
    CONDITIONAL LOGIC.

    Thank you in advance for your plugin and timing

    Posted 12 years ago on Wednesday May 2, 2012 | Permalink
  16. I have something similar but it involves sending the notification email to the visitor who completed the form. The form asks the vistor to select documents to download. The email to them must contain links to the documents selected. There will be a total of 7 documents that the visitor can choose from, and they can choose more than one. The checkboxes have values of 1 through 7 and the logic is

    if 1 then display link to doc 1
    if 2 then display link to doc 2

    and so on. How do I code this logic in the email?

    Thank you.

    Philip

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  17. Philip, I'm thinking you can use the conditional notification shortcodes. Check out this documentation:
    http://www.gravityhelp.com/documentation/page/Shortcodes#Conditional_Shortcode

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  18. Thanks Rob, I'll try that and see how I get on.

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  19. Hi,

    Here is the code that I am testing

    [gravityforms action="conditional" merge_tag="{EU Savings Tax Directive:5.1}" condition="is" value="01"]
    EU Savings Directive Investment Guide
    [/gravityforms]

    and here is the error message that appears in the resulting email

    Oops! We could not locate your form.

    I'm not sure if the merge-tag is the issue as it is a checkbox in a form field.

    Thanks again.

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  20. Is "01" the value of that EU Savings Tax Directive Checkbox? Have you tried any variants and do you have a link to your form by chance?

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  21. Hi Rob,

    Yes, 01 is the value of the EU Savings Tax Directive Checkbox.

    There is no link back to the form from the email.

    I will try some variants this morning.

    This morning I get different results. I no longer get the "Oops! We could not locate your form." error.

    The link text does not display when a box is checked.

    My understanding is that the checkbox value is only set when the box is checked by the visitor. If I am wrong then I am perhaps using the wrong merge-tag.

    Posted 12 years ago on Friday May 11, 2012 | Permalink
  22. Hi Rob,

    I have now tried several variants of the condition and the value and still the short code does not display the content that I have between the [gravityforms action="conditional" merge_tag="{EU Savings Tax Directive:5.1}" condition="is" value="1"] and the [/gravityforms].

    I removed the link on one occasion but this had no effect.

    Thanks for your help.

    Posted 12 years ago on Friday May 11, 2012 | Permalink
  23. Can you export the form and send the XML file to me to rob@rocketgenius.com and reference this post. I'm going to need to look at the form to see better what it is exactly you are trying to achieve.

    Posted 12 years ago on Friday May 11, 2012 | Permalink
  24. Hi Rob,

    Sent it just now.

    Philip

    Posted 12 years ago on Friday May 11, 2012 | Permalink
  25. Hi,

    Rob has already looked at this issue but was unable to replicate it. The issue is now apparent to my client at 2 locations in Europe.

    The code currently reads

    [gravityforms action="conditional" merge_tag="{Select your Guides:5}" condition="is" value="EU Savings Tax Directive"]
    EU Savings Tax Directive Investment Guide
    [/gravityforms]
    [gravityforms action="conditional" merge_tag="{Select your Guides:5}" condition="is" value="Personal Insurance"]
    Personal Insurance Investment Guide
    [/gravityforms]
    [gravityforms action="conditional" merge_tag="{Select your Guides:5}" condition="is" value="Estate Planning"]
    Estate Planning Investment Guide
    [/gravityforms]
    [gravityforms action="conditional" merge_tag="{Select your Guides:5}" condition="is" value="Planning for Retirement"]
    Planning for Retirement Guide
    [/gravityforms]
    [gravityforms action="conditional" merge_tag="{Select your Guides:5}" condition="is" value="Wealth Management"]
    Wealth Management Guide
    [/gravityforms]

    However, the links do not appear as they should either on the notification email or the confirmation message.

    Any help will be appreciated.

    Philip

    Posted 12 years ago on Monday June 4, 2012 | Permalink
  26. David Peralty

    Philip, in the drop down, can you try to put a check mark in enable values and then try again?
    If that doesn't work, can you send me an admin user/pass so I can get one of the developers to look?

    Posted 12 years ago on Monday June 4, 2012 | Permalink
  27. Just run a couple of tests on my code.

    If I select only one option the whole thing works but if I select more than one option it doesn't work.

    Posted 12 years ago on Monday June 4, 2012 | Permalink
  28. David Peralty

    Ah, now I understand. The issue with that is that when more than one option is selected, an array of values is sent, and so it won't be equal to the values you've stated in your condition. I am not sure off the top of my head how to get all of them to work with conditional shortcodes like you have set up currently. I will talk to the others and see what we can come up with.

    Posted 12 years ago on Monday June 4, 2012 | Permalink
  29. Hi David,

    I think that I have fixed the issue (at least it now works for me). Instead of

    merge_tag="{Select your Guides:5}"

    The merge tag should be at the next level down

    merge_tag="{EU Savings Tax Directive:5.1}"
    merge_tag="{Personal Insurance:5.2}"

    And so on.

    I have enable values checkbox checked.

    Thanks for getting back to me and best wishes to Rob.

    Philip

    Posted 12 years ago on Monday June 4, 2012 | Permalink
  30. David Peralty

    So everything is working as you expect it to?

    Posted 12 years ago on Monday June 4, 2012 | Permalink
  31. Can you please give an example of what Carl Hancock mentioned above? I have form 1 containing one field called "city" (without quotes) and want to pass that to form 2 and put that value in a field named "city1" . I've read the post http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population
    and I'm still confused. In the post the http://siteurl.com/form-url/?your_parameter=value
    how do I put the data of the "city" field in form 1 in the "value" parameter in the string above?
    Is value the name of the field?

    Carl wrote above:
    To do this you will need to Setup Form 1 so that it's confirmation is a redirect to the page containing Form 2. Choose the URL Redirect and type the full path to the page containing Form 2 and then use the query string builder to pass email={email field value} so that it redirects to the page containing Form 2 and passes the value of the email field in the query string.

    On Form 2 you would edit the Email field, selected the Advanced tab and choose the option to enable the field to be populated dynamically. For the parameter name you would use "email" (without the quotes).

    Now when you link to the page containing form 2 and pass ?email=the@email.com in the query string it should pre-populate that email field. If you setup Form 2 properly it will do this as it's confirmation redirect.

    Posted 12 years ago on Sunday June 10, 2012 | Permalink
  32. Never mind I found it!
    http://www.gravityhelp.com/forums/topic/tutorial-two-stage-form-with-data-passed-by-query-string

    Good explanation!

    Posted 12 years ago on Sunday June 10, 2012 | Permalink

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