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 do I get the form to open when someone clicks an image vs a link?

    Asked by jamaciaj08 on October 21, 2011 at 12:53 PM

    I need to know how to modify the code to get a form to open when the user clicks an image instead of a link. I would like it to open using the lightbox format.

  • Profile Image
    JotForm Support

    Answered by liyam on October 21, 2011 at 04:03 PM

    To be able to use an image as your link for your lightbox, simply get the lightbox code from your form:

    1. Edit your form
    2. Click Embed Form
    3. Select Lightbox
    4. Get the code and place it on your web page.

    Here's a sample lightbox script:

    <script src="//www.jotform.com/min/g=feedback" type="text/javascript">
    new JotformFeedback({
    formId:'11814245193',
    base:'http://www.jotform.com/',
    windowTitle:'Test Form',
    background:'#FFA500',
    fontColor:'#FFFFFF',
    type:1,
    height:500,
    width:700
    });
    </script>
    <a class="lightbox-11814245193" style="cursor:pointer;color:blue;text-decoration:underline;">Sample Contact with confirmation page and send post data</a>

    Once you have already placed the code on your web page, simply find the URL of the image that you wish to use. 

    example: http://spiritquestors.zzl.org/jotform/images/pdf.jpg

    Then, replace the text inside the lightbox link.  Please refer to the sample text that you will have to replace in the script above (the text in bold and enclosed with <a class="... > and </a> tags).

    Here's a sample image code:

    <img src="//spiritquestors.zzl.org/jotform/images/pdf.jpg" border="0">

    Here is a sample completed script:

    <script src="//www.jotform.com/min/g=feedback" type="text/javascript">
    new JotformFeedback({
    formId:'11814245193',
    base:'http://www.jotform.com/',
    windowTitle:'Test Form',
    background:'#FFA500',
    fontColor:'#FFFFFF',
    type:1,
    height:500,
    width:700
    });
    </script>
    <a class="lightbox-11814245193" style="cursor:pointer;color:blue;text-decoration:underline;"><img src="//spiritquestors.zzl.org/jotform/images/pdf.jpg" border="0"></a>

    Once you have replaced the text with an image source, you will have a clickable image that will show a lightbox once clicked.

    Here is the sample working script:

    If you need further clarification regarding this matter, please let us know.