Is there a solution to preload a form before display it?

  • Profile Image
    enesco
    Asked on August 27, 2017 at 02:09 PM

    Hello !

    My form is very long and contains some images and HTML5 animation (added using iframes).

    On the first page launching some elements are displayed slowly and iframes are launched at last. The result is not so good in term of design.

    Is there a solution to preaload a form before display it?

    If not...im thinking of displaying a white div on the whole page during 3 seconds, but its not so clean.

     

    Thanks!

  • Profile Image
    Nik_C
    Answered on August 27, 2017 at 02:43 PM

    I'm afraid that we don't have a way to insert such delay in our forms since it is very limited what you could do with the custom code in our builder.

    Probably the best way to go is to download the Source Code of the form and then delay loading of divs that have the frames you need to be delayed by using some JavaScript, for example (jQuery):

    https://stackoverflow.com/questions/9672580/delay-div-onload

    https://forums.asp.net/t/2061422.aspx?Any+way+to+load+the+DIV+in+html+page+after+5+seconds+

    If you have any additional questions please let us know.

    Thank you!

  • Profile Image
    enesco
    Answered on August 28, 2017 at 05:11 AM

    OK, so i will had a "Fake loader" to prevent slow display.

    Thanks for the links.

    Regards,

     

    Seb

  • Profile Image
    Nik_C
    Answered on August 31, 2017 at 11:45 AM

    I checked your script and I would say that it is not good, rather try with this for your setTimeout function:

    <script>

    setTimeout(function() {

        $('#loader').fadeOut(1000);

    });

    </script>

    I saw the error in console and 'hide' is not recognizable by fadeOut function.

    Please try that and let us know if it worked.

    Thank you!

  • Profile Image
    enesco
    Answered on August 31, 2017 at 12:57 PM

    Unfortunately it work on a simple page :

    http://optimeo-prevention.com/ecoachingbeta/test.html

    But not in my Jotform...

    http://optimeo-prevention.com/ecoachingbeta/index4.html

    strange because its a really simple fonction...

    Thx

     

    Seb.

  • Profile Image
    Kevin_G
    Answered on August 31, 2017 at 02:45 PM

    I have tested this and found the same issue, seems like there is a conflict with the code that hides the element.

    First off, you will not need to call the jQuery file again as JotForm resources will already load a jQuery version. 

    Now, the code that hides the element will need a change, so this is the only code you need: 

    <script>

    setTimeout(function() {

        jQuery('#loader').fadeOut(1000);

    });

    </script>

    I hope this helps. 

  • Profile Image
    Nik_C
    Answered on September 01, 2017 at 03:55 AM

    Thank you for getting back to us. 

    I'm glad you were able to make it work. But I must say this is odd since $ is a representation of jQuery. So when you write $ it is like you wrote jQuery.

    Anyhow, if you have any additional questions please let us know.

    Thank you!

  • Profile Image
    Chriistian
    Answered on September 01, 2017 at 04:55 AM

    Thank you for letting us know.

    If you have other concerns or need further assistance, please don't hesitate to get back to us.