Scripting conflicts when using the Lightbox embed code

  • Profile Image
    Mac 
    Asked on May 11, 2016 at 07:12 AM

    Hi,

     

    When we copy/paste the lighbox form code in our page, we start having errors ($.getJSON is not a function) in other js pieces of our page. It is like jotform removes jquery. Please advise.

     

    The script we pasted from jotform is 

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

          var JFL_61312864489564 = new JotformFeedback({

            formId: '61312864489564',

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

            windowTitle: '',

            background: '#FFA500',

            fontColor: '#FFFFFF',

            type: '2',

            height: 550,

            width: 700,

            openOnLoad: false

          });

        </script>

     

    Thanks,

  • Profile Image
    Boris
    Answered on May 11, 2016 at 09:10 AM

    Hello Mac, and welcome to JotForm. :)

    The feedback.js script is using the prototypeJS scripting library for the Lightbox.

    Can you please try editing feedback.js into feedback2.js and see if that helps? The feedback2.js script will load with JQuery scripting library, so your embed code should look like this:

    <script src="https://form.myjotform.com/static/feedback2.js?3.3.REV" type="text/javascript">
          var JFL_61312864489564 = new JotformFeedback({
            formId: '61312864489564',
            base: 'https://form.myjotform.com/',
            windowTitle: '',
            background: '#FFA500',
            fontColor: '#FFFFFF',
            type: '2',
            height: 550,
            width: 700,
            openOnLoad: false
          });
        </script>

    Please let us know if the above fixed the issue you were having with scripting conflicts between JQuery on your page and prototypeJS from the Lightbox.

    I also noticed that you are using a non-registered guest account, which is meant for quick demonstration purposes and is therefore limited to receiving only up to 20 submissions per month. I would highly recommend signing up for a regular free account, which will enable you to receive up to 100 submissions per month:

    https://www.jotform.com/signup

    If you need further assistance, we are here to help.