Setting up lightbox jotform that opens only once per session - without the use of PHP

  • roblucas
    Asked on January 20, 2015 at 4:59 PM

    Hi,

     

    I have followed the tutorial here:

     

    http://www.jotform.com/help/140-Using-Cookies-to-Auto-Open-a-Lightbox-Form-Per-Browser-Session

     

    But cannot get the functionality to work. Where exactly on the FTP server should the php file be located?

     

    Thank you,

     

    Ryan

  • Elton Support Team Lead
    Replied on January 20, 2015 at 5:56 PM

    Hi Ryan,

    You have to upload the php file to your server after creating it. You can place it anywhere you want as long as the server supports PHP. Or you can embed the entire PHP code within the existing php file on your server. Sorry but we do not host php files here.

    Let us know should you have further questions. Thank you!

  • roblucas
    Replied on January 20, 2015 at 6:02 PM

    I actually found out my server does not support PHP. Is there a javascript option or other workaround to add the cookie for new browser sessions?

  • Elton Support Team Lead
    Replied on January 20, 2015 at 6:08 PM

    Hi,

    I think that's possible with javascript. I'm not that good with javascript but I'll get back to you later today with the javascript version of that guide.

    Stay tuned for the updates!

  • roblucas
    Replied on January 21, 2015 at 11:11 AM

    Hi, any word on the javascript version, or non php version?

     

    Thank you,

     

    Ryan

  • Ben
    Replied on January 21, 2015 at 12:04 PM

    It would be best if you can give us the link to the page with jotform on your website, but the general idea of javascript cookies would go like this:

    document.cookie = "my cookie value";

    If there are no other cookies on your website then it would be possible to add the lightbox code into a code bloc such as this one:

    if(document.cookie)
    {
     //lightbox code goes here
    }

    If of course there are other js cookies on your website you would need to go over all of them and find the one you have set, which we would be happy to assist you with, but as it would only add complexity, I would like to keep to the first / simpler version and see how it goes.

    Now as you say that it is not supporting php I presume that it is supporting ASP instead?

    If so, please take a look here: http://www.jotform.com/answers/68564-nice-guide-thanks-

    ASP and PHP are fairly similar and working with them means that you are not relaying on user browser cookies.

    I would also like to mentioned that I believe that the javascript cookies are per page, not per session, but would need to look into that.