Someone here very kindly gave me this script to disable a 'send form' button at a certain time. It works great! Thanks again!
var expMsg = document.getElementById("expireMsg");
var subBtn = document.getElementById("subBtn");
var terminate = new Date("October 30, 2018 20:30:00");
//
function start() {
checkForExpiration();
}
//
function checkForExpiration() {
expMsg.innerHTML = "";
subBtn.disabled = false;
var currentDate = new Date();
//
if (currentDate > terminate) {
subBtn.disabled = true;
expMsg.innerHTML = "Sorry, but I said send the homework before 8:30pm today. You are too late.";
return false;
} else {
return true;
}
}
//
window.onload = start();
What I would like to do is use something similar to switch a link to a formpage on. This is just a homework page, no sensitive data or stuff.
To get to the formpage with the homework, you click a nice green rollover button on another page like this:
<li><a href="17week7.html">学期第七周<p>week7 </p></a></li>
I think the best way to achieve what I want is to make this button come live at a certain time. I think the above function could be modified to do this, but I don't have sufficient knowledge to do that.
Any tips, hints or links for this rank amateur please?