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 to have a ligthbox form in mobile browser

    Asked by Chris on November 11, 2016 at 08:23 PM
    the catch is I want the form to be 500 px wide on larger screens but only 250 wide on phones. is there a way to do this? would be great if I could just do 90% width but it doesn't seem to register % for lighthouse or feedback form. 
  • Profile Image
    JotForm Support

    Answered by EltonCris on November 12, 2016 at 12:58 AM

    That's possible.

    1. First, you will have to create a form and get its lightbox embed code.


    2. You will have to modify your lightbox embed code so it shows perfectly on mobile. To do just insert the following script after the script tag found in your lightbox embed code.

    var parentWidth = window.innerWidth;

    if(window.innerWidth <= 499) {parentWidth = window.innerWidth-100;} else {parentWidth =  500;}

    3. Then change the width value with this variable parentWidth

    This is how it would look like afterwards. Changes are highlighted in color light green.

    <script src="https://form.jotform.com/static/feedback2.js?3.3.REV" type="text/javascript">

        var parentWidth = window.innerWidth;

        if(window.innerWidth <= 499) {parentWidth = window.innerWidth-100;} else {parentWidth =  500;}

         var JFL_52935598338976 = new JotformFeedback({

           formId: '52935598338976',

           base: 'https://form.jotform.com/',

           windowTitle: 'My Form Title',

           background: '#2056c6',

           fontColor: '#FFFFFF',

           type: 'false',

           height: 500,

           width: parentWidth,

           openOnLoad: true



    If you need further assistance, let us know.

  • Profile Image

    Answered by MBizTools on November 12, 2016 at 08:44 AM

    That worked! Many thanks. I can work with that custom coding format. Much appreciated. I'll use on my other forms.