Reading URL Query Parameters From a Form

  • ablbol
    Asked on May 8, 2015 at 2:54 AM

    I tried to read your forum but could not make think to work for me.

    I have page 1 & page 2 in Google Sites.  

    In page 2, I have JotForm form embedded into the page as gadget.  One of the fields in the form is called name18.  

    In page 1, I have a link to page 2 that goes to http://page2?name18=Bill

    When I click on the link in page 1, I expect to go to page 2 and see the "name" field in the form to be populated with "Bill".  But that is not the case.  

    What is it that I am doing wrong? I am sure of the name of the field.

    Thanks

  • BJoanna
    Replied on May 8, 2015 at 9:43 AM

    Can you please explain in more details what are you trying to achieve?

    Are you trying to populate fields to your JotForm via URL parameters? If so please read this article to find out how to do it:

    http://www.jotform.com/help/71-Prepopulating-fields-to-your-JotForm-via-URL-parameters 

    If you want to save form and continue later please read this guide:

    http://www.jotform.com/features/save-and-continue/ 

    Considering that you did not provide us valid url of website, I need to mention that is not possible to use session on your own domain. Session is only possible with JotForm domains. What you need to do is to capture the parameters in the php/asp on your website and then pass the values to the form embed code.

    But that is not possible to do directly when form is just embedded.

    You can look into thread where similar problem is explained how can be resolved:

    http://www.jotform.com/answers/534646

    Hope this will help. Let us know if you need further assistance. 

  • ablbol
    Replied on May 8, 2015 at 1:11 PM

    I am  trying to populate fields to my JotForm via URL parameters.  However, I am embedding my form to Google site as Gadget and not as IFrame.  As for IFrame, I was able to populate the form.  But what about Gadgets?

    Thanks

  • KadeJM
    Replied on May 8, 2015 at 1:36 PM

    By default the Google Site is actually the recommended method for embedding your jotform(s) via the Google Gadget Method which is recommended in this guide for http://www.jotform.com/help/19-Adding-Form-to-Google-Sites.

     

    To my knowledge this should work but it seems that something might not be configured properly. Have you tried using this with our Prepopulation Generator? This is mention for the Url Parameter Guide but sometimes it may not work if it gets stripped depending on the method used to embed.

    I tried to visit your link you provided above for http://page1/?name18=Bill to get a better idea of what is going wrong here but I seem to be unable to view it since it is currently unavailable on my end which leads me to believe it may be incorrect.

    Are you able to provide us with a link to the google pages your forms are on that you are trying to use the propopulation with?

  • ablbol
    Replied on May 8, 2015 at 1:48 PM

    Here is a link of a page that contains "Enquire" JotForm at the bottom.  

    http://www.alwafaequipment.com/wheelloaders/1078

    I have managed to embed the form as IFrame in my Google site.  The form has hidden field called "stock".  I am passing stock parameter in the URL that I generated using Prepopulation Generator.  The stock field in the form gets populated with no problem (with IFrame not with Gadget).  When the user submits the form, I receive an email indicating which stock he is enquiring about.  Without the stock field, I will not be able to know which stock my customer is interested in.  So passing URL parameter in the IFrame has worked out well for me.  I would like to do the same thing with Gadget since it is the prefered why in Google Sites.  Can you tell me how to pass URL parameter in my Gadget so that the stock field is prepopulated.

    Thanks

     

  • BJoanna
    Replied on May 8, 2015 at 2:35 PM

    I have tested Gadget option with additional URL parameters and you need to do following:

    1. You need to use Prepopulation Generator to generate additional parameters on your URL.

    Reading URL Query Parameters From a Form Image 1 Screenshot 20

    2. After that you need to use Google site option to embed your form to the Google site. 

    http://www.jotform.com/help/19-Adding-Form-to-Google-Sites 

    Steps how to embed gadget on Google site are described on the link above.

    On the step when you need to enter the gadget URL which you've got from the JotForm wizard, gadget settings will open.

    Then you should write your formID ( ) in order to add your form into your page. Form ID is a string of numbers found at the end of your form URL. You need to write form ID with additional parameters that you got from Prepopulation Generator e.g.

    51275347969974?name=Bill 

    Hope this will help. Let us know if you need further assistance. 

  • ablbol
    Replied on May 8, 2015 at 5:00 PM

    It works. Thanks.

    The key is in passing the parameters with the ID 51275347969974?name=Bill 

  • Carina
    Replied on May 8, 2015 at 5:19 PM

    Thank you for updating us. I'm glad that it works now.

    Let us know if we can assist you further.