Jump to content
  • 0

Turn Off Submission Form after Specific Date


RJOHNSON

Question

4 answers to this question

Recommended Posts

  • 0

You need to disable deployment on that specific date. There is another way to disable submit button but smart developers can hack it. add the code below to the footer

<div id="msg"></div>
<script>
var date= new Date('03/04/2018');
var today = new Date('[@cbTimestamp*]');
if (date < today){

document.getElementById('Submit').style.display= 'none';
document.getElementById('msg').innerHTML = 'Promotion is over';
} 

</script>

 

Link to comment
Share on other sites

  • 0
On 3/8/2018 at 6:00 AM, RJOHNSON said:

Thank you for the input. That is an option.
Do you have any knowledge on how to disable or hide the entire form after a date?

Put your form code (iFrame or embed code) into a div, give the div an id name, then follow steps above to hide the div and it's contents (your form). I use a different script, but it does the same as above.

<!-- add these css styles to top of page to hide form and over message on page load -->
<style type="text/css">
#overMessage {display:none}
#entryFormWrap {display:none}
</style>

<!-- div with form code inside it will be hidden on expire time -->
<div id="entryFormWrap">
<h3>Entry Form</h3>
<iframe frameborder="0" height="432" name="Web Form" scrolling="auto" src="https://b4.caspio.com/dp.asp?AppKey=yourkeynumberhere" title="Web Form" width="330">Sorry, but your browser does not support frames.</iframe>
</div>

<!-- div with over message hidden until expire date has been reached -->
<div id="overMessage">
This Contest Has Ended.
</div>

<!-- put this script at bottom of page -->
<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {
var current = new Date();
var expirenow  = new Date("May 7, 2018 23:59:59") ;

document.getElementById("entryFormWrap").style.display = "inline-block";
document.getElementById("overMessage").style.display = "none";

if(current.getTime()>expirenow.getTime()){
  document.getElementById("entryFormWrap").style.display = "none";
  document.getElementById("overMessage").style.display = "block";

 }
});
</script>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...