SOLVED

Re: Anyway to automatically "turn off" a form after a certain time?

Go to solution
Anonymous
Not applicable

Anyway to automatically "turn off" a form after a certain time?

I work with webinar campagins; currently, I email our house list and have a "Register here" link that directs people to fill out a form to register for webinars.

Problem: Since the registeration link is in the email, people are able to access the link (and fill out the form) even after the webinar is over. Right now, I have people registering after the webinar is over, even though the registration page clearly states when the webinar started. 

Question: Is there a way to automatically "turn off" a form after a certain time so I can prevent these people from registering or redirect them? Right now, I go in after the webinar is over and just delete the form manually. 

Any help would be appreciated, even if it's a "this cannot be done." 
 
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Kenny_Elkington
Marketo Employee

Re: Anyway to automatically "turn off" a form after a certain time?

Hey Mengchao,

You can do this with a little piece of Javascript.  It will hide the form if today's date is after your designated closed date, and display alternative content:

<script>
MktoForms2.whenReady( function(form) {
var today = new Date(); //set the current date
var registrationClose = new Date("1970/01/01"); //change to your desired date
if (today > registrationClose) {
$(".mktoForm").wrap( "<div class='formHolder'></div>" );
$(".mktoForm").hide();
$(".formHolder").append('<div><p>Sorry! Registration for this event is now closed.</p></div>'); //change to your desired content here, set appropriate classes/IDs for styling
};
});
</script>

View solution in original post

13 REPLIES 13
Anonymous
Not applicable

Re: Anyway to automatically "turn off" a form after a certain time?

Hi,

It doesn't seem like you can turn off the form but you can create an alternative campaign.

Smartlist:
Batch filter 1:
Fill out Form after DATE

Flow options:
-remove lead from list 
-send autoresponder (telling lead that the webinar is over)
-change data value
-remove from flow
-etc.
Anonymous
Not applicable

Re: Anyway to automatically "turn off" a form after a certain time?

Hi,

It doesn't seem like you can turn off the form but you can create an alternative campaign.

Smartlist:
Batch filter 1:
Fill out Form after DATE

Flow options:
-remove lead from list 
-send autoresponder (telling lead that the webinar is over)
-change data value
-remove from flow
-etc.
Kenny_Elkington
Marketo Employee

Re: Anyway to automatically "turn off" a form after a certain time?

Hey Mengchao,

You can do this with a little piece of Javascript.  It will hide the form if today's date is after your designated closed date, and display alternative content:

<script>
MktoForms2.whenReady( function(form) {
var today = new Date(); //set the current date
var registrationClose = new Date("1970/01/01"); //change to your desired date
if (today > registrationClose) {
$(".mktoForm").wrap( "<div class='formHolder'></div>" );
$(".mktoForm").hide();
$(".formHolder").append('<div><p>Sorry! Registration for this event is now closed.</p></div>'); //change to your desired content here, set appropriate classes/IDs for styling
};
});
</script>
Oliviatran
Level 1

Re: Anyway to automatically "turn off" a form after a certain time?

Hi Kenny, 

Thanks for your advice. May I ask where to put the script you shared? In the form itself or the landing page hosting the form? Can you give more detailed instruction on this? 

Many thanks 

Jo_Pitts1
Level 10 - Community Advisor

Re: Anyway to automatically "turn off" a form after a certain time?

@Oliviatran ,

on the page hosting the form.

Cheers

Jo

Kenny_Elkington
Marketo Employee

Re: Anyway to automatically "turn off" a form after a certain time?

I Should note that Sydney's comment is not a viable solution.  The Date of Activity filter in the Fills out Form trigger only works for past date ranges in conjunction with the Minimum Number of Times constraint.  Forward-looking operators will not function that way.
Anonymous
Not applicable

Re: Anyway to automatically "turn off" a form after a certain time?

Another suggestion which is somewhat manual is to create a re-direct rule on the landing page that includes the registration form.  What's nice about this, is if you have a new webinar you want to promote, you can redirect there.
Anonymous
Not applicable

Re: Anyway to automatically "turn off" a form after a certain time?

Thanks for all of your replies--I've never used discussions before, but I'm convinced I'll be using it more frequently now!

@Kenny - is it possible for code to be based on the hour (for specificity) instead of the close date?
Kenny_Elkington
Marketo Employee

Re: Anyway to automatically "turn off" a form after a certain time?

Yes you can do a more specific comparison, you would just do this instead:

<script>
MktoForms2.whenReady( function(form) {
var today = new Date(); //set the current date
var registrationClose = new Date("01 January 1970 00:00:00 GMT"); //change to your desired date
if (today.getTime() > registrationClose.getTime()) {
$(".mktoForm").wrap( "<div class='formHolder'></div>" );
$(".mktoForm").hide();
$(".formHolder").append('<div><p>Sorry! Registration for this event is now closed.</p></div>'); //change to your desired content here, set appropriate classes/IDs for styling
};
});
</script>

getTime gets the exact time instead of just the date and it will perform that comparison instead.