Thank you page automatically diverts back Entry form page 1 (after a time limit is reached)

Adele_Grono2
Level 2

Thank you page automatically diverts back Entry form page 1 (after a time limit is reached)

Hi there

I am doing a form, it will be on an iPad it is a competition, the iPad will be used at a trade show (note the Tradeshow has a good Wifi connection).

The competition is to encourage attendees / people who visit the booth to fill out the form.

The aim is to capture as many leads as possible at the trade show, as the client can have 10 attendees waiting at the booth, waiting to speak to a sales rep.

Once an attendee has filled in the Entry page (Page 1) I would like the attendee to see the Thank you page (Page 2) for 3 or 5 seconds, then the page automatically returns to the Entry page (Page 1), this will allow  the next attendee to fill in their details.

Sorry I don't want the Sales Reps at the stand to be constantly pressing a "return to entry page" button while they are talking to attendees / potential sales opportunities at the trade show booth. I have attached an example below.

code for returing to page v2.jpg

Sorry what CSS or Javascript code I have to add to the form?

FYI - the form and landing page are hosted in Marketo.

Thanks so much

Sorry any advice  Sanford Whiteman   thank you.

3 REPLIES 3
Jim_Thao7
Level 9

Re: Thank you page automatically diverts back Entry form page 1 (after a time limit is reached)

Try this script on your Page 2 Thank you page: <script>setTimeout(function(){window.location.href='Page 1 - Entry Page.html'},3000);</script>

SanfordWhiteman
Level 10 - Community Moderator

Re: Thank you page automatically diverts back Entry form page 1 (after a time limit is reached)

I would guard that a bit, otherwise you can't stay on the Thank You page to proofread/troubleshoot it, even if you go directly to it.

var normalizedRef = document.createElement("a"),

    normalizedLoc = document.createElement("a");

normalizedRef.href = document.referrer;

normalizedLoc.href = document.location.href;

[normalizedRef,normalizedLoc].forEach(function(loc){

  ["search","hash"].forEach(function(component){

    loc[component] = "";

  });

});

if (window.parent == self && normalizedRef.href != normalizedLoc.href) {

  setTimeout(function(){

    document.location.href = document.referrer;

  }, 3000);

}

This way, you redirect to the referring page only if that page (a) exists and (b) is different from the current one, ignoring querystring and hash.

Jay_Jiang
Level 10

Re: Thank you page automatically diverts back Entry form page 1 (after a time limit is reached)

Another way you could do it is to show the thankyou message inline and reload the page in onsuccess