SOLVED

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

12 REPLIES 12
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>
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.

Nicholas_Manojl
Level 9

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

This is pretty cool.

I wonder..could the registrationClose reference a {{date.token}}?

SanfordWhiteman
Level 10 - Community Moderator

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

Sure.  That's the way it's done in other posts on this topic.  Just remember that '2015-11-10'  == November 10 at 00:00:00 GMT == November 9 at 7:00pm Eastern.