SOLVED

Re: Ideas to knowledge form submission, then refresh form after a delay?

Go to solution
Anonymous
Not applicable

Ideas to knowledge form submission, then refresh form after a delay?

I'm creating a landing page with Marketo form embedded and this will be used at a tradeshow. I want people to fill out the form, receive some sort of aknowledgement (like text that says thank you and disappears after a few seconds), and then for the form to be refreshed (actually probably makes more sense for the form to refresh, and then thank you text to appear). 

Does anyone know how to implement this or have other ideas?

I've figured out how to get a Thank you text to show with the submission, but then the form refreshes right away so I only see the message for a quick flash.

I used an idea found on another thread. Here's my code:

<script src="//app-sjg.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_XXXX"></form>
<script>MktoForms2.loadForm("//app-sji.marketo.com", "nnn-nnn-nnn", XXXX, function(form){
  //Add an onSuccess handler
  form.onSuccess(function(values, followUpUrl){
  document.getElementById('confirmform').style.visibility = 'visible';
});});</script>
 <div id="confirmform" style="visibility:hidden;"><p><strong>Thank you.</strong>.</p></div>          
 
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Ideas to knowledge form submission, then refresh form after a delay?

function(form){
  form.onSuccess(function(values, followUpUrl){
      document.getElementById('confirmform').style.visibility = 'visible';
      setTimeout(function(){document.location.href = followUpUrl},4000);
      return false;
    });
 });

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Ideas to knowledge form submission, then refresh form after a delay?

function(form){
  form.onSuccess(function(values, followUpUrl){
      document.getElementById('confirmform').style.visibility = 'visible';
      setTimeout(function(){document.location.href = followUpUrl},4000);
      return false;
    });
 });
Anonymous
Not applicable

Re: Ideas to knowledge form submission, then refresh form after a delay?

Thanks Sanford. I tried a variation of that but I think I had some syntax wrong. Anyways, thanks again! That worked.
Anonymous
Not applicable

Re: Ideas to knowledge form submission, then refresh form after a delay?

Sanford - do you happen to know - My message shows up fine, but actually shows up on top of the submit button, so I added 2 BR tags within my DIV tag where the confirmation message is. However, the breaks show all the time, so there's a big gap of padding at the bottom of my form.

Any idea on how to fix this? I tried throwing the form in a table and the message in a new row, but that didn't work.
SanfordWhiteman
Level 10 - Community Moderator

Re: Ideas to knowledge form submission, then refresh form after a delay?

I would have to see the HTML (i.e. URL) of your page to know exactly what you're talking about.