How to pre populate recipient selection of embedded form

  • brewerben
    Asked on July 6, 2016 at 4:10 PM

    I was wondering if it is possible to have a button from a page populate the recipient field.

    Example:

    We have 11 different people on our website and when you click the "contact person" button it goes to a page that has our form embedded into it.  The form has a dropdown at the top of who you would like to contact. All of the contact buttons do the same thing. You click "contact person" > it goes to the page with the form > then you have to select again who you want to contact from the dropdown. It is a little redundant. The easy but inefficient way to fix this would to just create a page for each contact and just link each button to a separate form. Then you have 11 different forms AND pages you have to deal with then. 

     

    I am wondering if there is a way to click the "contact person" button and it auto populate the recipient field when it goes to the form page.

    I hope this makes sense.

    Thanks.

  • Boris
    Replied on July 6, 2016 at 5:48 PM

    Yes, you can prepopulate your form by using URL parameters:

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

    This means that you could simply append ?input9=Youth to the end of your form's URL, and it will load with "Youth" selected as the recipient. You can see this in action by opening this as your form's link:

    https://form.jotform.us/form/60763888176168?input9=Youth

    This also works with most websites out of the box, so you could normally simply use an URL parameter such as this to have your embedded form prepopulated:

    http://northtexas.ag/contact-us/?input9=Youth

    However, on your exact Wordpress website, you seem to be using a plugin or script named "Lazy Load" or something very similar. That plugin/script is, by its nature, preventing any prepopulation of our forms to work on your website.

    So please first try disabling the "lazy loading" script or plugin that your site is using, and then you can simply change the link in the buttons that point to your contact page - so that each link will automatically prepopulate the recipient field from the URL parameter.

    For example, on page http://northtexas.ag/youth/ you would use this link in the contact us button:

    http://northtexas.ag/contact-us/?input9=Youth

    On page http://northtexas.ag/men-2/ you would instead use this link in the contact us button:

    http://northtexas.ag/contact-us/?input9=Men

    If you need any further clarifications or guidance, please let us know. Thank you.