What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How can we pass the email from our website to the form embedded with js embed code?

    Asked by memaxt on June 19, 2015 at 12:03 PM

    Hi there,

    Is it possible to pass a value from my Main website onto the embedded form.

    layout of site:

    Main Website -> Embed form using  <script type="text/javascript" src="//form.jotform.co/jsform/40125085918858"></script>

    I would like to pass through users email address from the main website onto the embedded form.

    How would I do that using the embedded code above?

    pass value pass layout jsform url prepopulating URL pass parameter
  • Profile Image

    Answered by memaxt on June 19, 2015 at 12:35 PM

    I can do it by embedding the full source but its causing css errors on my wordpress website. I refuse to use iframe option.

  • Profile Image

    Answered by Ben on June 19, 2015 at 01:24 PM

    You can also do it with any other embed codes (iframe, js embed) the way to do it is to just set it all up for URL prepopulating.

    For example, you can see it in action like so: http://form.jotform.co/form/40125085918858?email=test

    Now when we turn it into the js embed code, we just change the URL to include the parameter that we need, like so:

    <script type="text/javascript" src="//form.jotform.co/jsform/40125085918858?email=test"></script>

    Now the tricky part here is the part where you are passing the email value, because you must add it over php or js code, depending on what you prefer and have available.

    Unfortunately we can not help with such custom solutions, but could help you with few pointers if needed so I advise hiring a developer (again depending on what you need to do exactly).

    I would recommend using the php code if possible and then just pass that value to email parameter, for example:

    <?php
    $email = '';
    $email = code_to_get_email_from_db(); //you would need to write this function
    ?>

    <script type="text/javascript" src="//form.jotform.co/jsform/40125085918858?email=<?php echo $email; ?>"></script>

    Do let us know how it goes.

  • Profile Image

    Answered by memaxt on June 19, 2015 at 01:42 PM

    you are a star!!!! :)

    used the following code on wordpress:

    <script type="text/javascript" src="https://secure.jotform.co/jsform/40125085918858?email=<?php $current_user = wp_get_current_user(); echo $current_user->user_email ?>"></script>