How to disable or never show the lightbox form again after someone submits it?

What is JotForm?

JotForm is a freeonline form builder which helps you create online forms without writing a single line of code.

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.

Why do you not want to answer this thread?(Your answer will be sent to Jeanette and Aytekin)

andrewholman

Asked on March 06, 2018 at 10:07 PM

I have a pop up signup form on my website. How do I set the code to disable the pop up form appearing once someone submits the form?

For the frequent viewer it can be quite annoying.

I did find a way to enable cookie sessions that keeps the pop up from appearing until the user quits their browser.

It will allow you to control to whom the popup will be shown, based on their cookies (if they saw the page or not).

Let us know if you have any further questions.

Thank you!

andrewholman

Answered on March 17, 2018 at 05:23 PM

What I am looking to do is to keep the cookie & user session active, not destroyed, after someone fills out the form and then quits their browser. This way when return visitors come to the site they will not receive the popup that they already signed up for.

Is this possible?

If so, how can I do this?

thx,

a

JotForm Support

Welvin

Answered on March 17, 2018 at 06:44 PM

I'm sure this is possible, but I think this needs you to redirect the form to a page, a thank you page where a cookie can be set with a URL value.

The lightbox shows the thank message in the same window, and I don't think you can set a cookie that way. I will try to look into this, and let you know.

andrewholman

Answered on March 19, 2018 at 01:51 PM

ok, thanks. Please let me know if possible and how I can do this.

A

andrewholman

Answered on March 20, 2018 at 09:12 PM

Hi ,any updates with this question?

thx,

a

JotForm Support

EltonCris

Answered on March 20, 2018 at 10:57 PM

There's a workaround. This would require an external thank you URL hosted on your website that would set a cookie on the user's browser when the form is submitted. If you'd like to try it, here's how:

1. First, you need to create your custom thank you page with the cookie script.

4. Lastly, update the PHP code that is embedded on your website with the following.

<?php

$showlightbox="0";

if(!isset($_COOKIE['beenhere']) && !isset($_COOKIE['formExpiry'])) {

setcookie("beenhere", '1');

$showlightbox="1";

}

?>

So this is how it'd work.

a. When the user visits your website for the first, the lightbox form is shown

--If the user closes the browser without submitting the form, the form will be shown again as soon as they revisit the page

b. If the user submits the form, another cookie without expiration will be added to their browser so when they visit your website again, they won't be able to see the form unless they will clear their browser's cache and cookies.

If you have further questions, let us know.

andrewholman

Answered on March 23, 2018 at 01:12 AM

Perfect, I really appreciate this. I will give it a try.

andrewholman

Answered on March 27, 2018 at 04:49 PM

Hello,

I implemented the pop up code on the index and the thank-you.php page and currently the only browser that functions properly is Chrome. Safari & Firefox do not even show the pop up for me even after clearing the cookies.