Passing a value into a form field from the web page the form is embedded into

  • Profile Image
    Asked on June 15, 2020 at 03:43 PM


    I have a web page, when a user has signed I can use javascript to get the user name. The page has a Jotform embedded into it. I want to pass the user name into a field on the form so when it's submitted that user name is part of the submission. I have a hidden field on the form I want to use to store that value. Is this possible?


  • Profile Image
    Answered on June 15, 2020 at 08:11 PM


    Yes, that will be possible. Let's take my demo form below:

     This is corresponding iframe code:







          allow="geolocation; microphone; camera"



          style="min-width: 100%; height: 539px; border: none;"



    You need to change the URL in the src field with the URL that has pre-populated values.

    You can use to prepopulate fields. In my case, if I want to prepopulate First name and Las name fields with Niko Jotform I need to use this URL:[first]=Niko&name[last]=Jotform

    However, if you have some variables that store name information, you can define the following:

    You can prepopulate URL using the JS template literals ${} to pass values of your variables and then use this link as a src for embed:

    You can copy the used code from here:

    I've tested and it works without any issues:

    Please give a try and let me know if you have any further questions.

    Thank you in advance!