Prepopulate Fields using JavaScipt

  • Profile Image
    Philipp_philipp
    Asked on October 30, 2020 at 06:46 AM

    Hello guys,

    im trying to figure out how to use JavaScript to prefill fields.


    Situation: User gets to a landing page (comx.io/quiz) .

    Complication: On the JotForm page, the UTM parameters will be gone because its a different page. So i want to save the UTM parameters in a cookie and push them into the form through javascript.

    I use Google Tag manager to achieve this but the fields won't fill. How can i solve this problem? Do i have to change the way the form is implemented into the page?

  • Profile Image
    Lorenz_A
    Answered on October 30, 2020 at 07:31 AM

    Hi there,

    You can prepopulate fields to your form via URL parameters.

    Here's a guide: https://www.jotform.com/help/71-prepopulating-fields-to-your-jotform-via-url-parameters

    I'm quite not sure, how it can be done in Javascript, but I think you will have to download the source code of your form and add your own custom code in order to achieve that.

    Guide: https://www.jotform.com/help/104-how-to-get-the-full-source-code-of-your-form

    I hope this helps. Let us know if you need any further assistance.