How can I limit the lightbox to popup only once per IP address?

  • sausagemaker
    Asked on August 23, 2018 at 12:28 PM

    Hello,

    I've found your guide detailing how to use php to have the lightbox form only show once per browser session but I'd like it to go a step further to have it only show once per IP address.

    It's a quick survey that I don't want to start annoying repeat visitors with every new session they visit. Just a one-and-done survey.

    Thank you for any assistance.

  • Richie JotForm Support
    Replied on August 23, 2018 at 1:12 PM

    You can try to enable the unique submissions in your form.

    How can I limit the lightbox to popup only once per IP address? Image 1 Screenshot 20

    Guide:https://www.jotform.com/help/64-How-to-Set-Unique-Submissions-on-a-Form

    Please give it a try and let us know if this fits your requirements.

    Thank you.

  • sausagemaker
    Replied on August 23, 2018 at 1:35 PM

    This is perfect, I didn't notice the show more options button earlier. Thank you!

  • sausagemaker
    Replied on August 24, 2018 at 4:57 PM

    I have to take back my previous statement, this is not what I was looking for. This does help me enforce multiple submissions from the same source, however, the form will pop up every time someone loads the page. Is there a way to have it load only on the first time they see it? If they choose to fill the survey out or not I'd prefer them to not have the lightbox show up every time.

    So if there's a way for cookies and/or ip address to load only on first instance that would be ideal.

    Any information would help greatly, thank you.

  • Support_Management Jotform Support
    Replied on August 24, 2018 at 7:40 PM

    I read around stackoverflow and other sources and this should be doable. However, the coding part has to be done from your end. The best we could do to help is point you in the right direction. The guides we provided for cookie-based sessions (with JS and PHP) are there to give developers an idea that these approaches are viable.

    However, I'm concerned on why you want to use the IP as the basis for this check. Most ISPs provide dynamic IPs to their users. One user who visits your site right now could have a different IP address 3 hours later (and the previous IP allocated to that user might be used by someone else who's using the same ISP).

    Have you tried looking at utilizing the built-in Local Storage feature of browsers? I found a good solution here using Javascript that you may want to have a look at.