hie guys, I have a countdown for my webpage and the code is as below. However I wld like to change the event date every now and then but I wouldnt want to open and edit the file all the time. Is there any way to change the value of say Mar 6 2007 09:00:00 to Mar 6 2007 10:00:00 on the fly or with an extra function thanks
<HTML>
<head>
<script LANGUAGE="JavaScript">
<!--
var now = new Date();
var event = new Date("Mar 6 2007 09:00:00");
var seconds = (event - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update() {
now = new Date();
seconds = (event - now) / 1000;
seconds = Math.round(seconds);
minutes = seconds / 60;
minutes = Math.round(minutes);
hours = minutes / 60;
hours = Math.round(hours);
days = hours / 24;
days = Math.round(days);
document.form1.hours.value = hours;
document.form1.minutes.value = minutes;
ID=window.setTimeout("update();",1000);
}
// --></script>
</head>
<body>
<form name="form1" method="post" action="">
<strong><font face="Century Gothic">Hours
<input type="text" name="hours" value="0" size="2">
Minutes
<input type="text" name="minutes" value="0" size="2">
</font></strong>
</form>
<p> </p>
</body>
</html>
<HTML>
<head>
<script LANGUAGE="JavaScript">
<!--
var now = new Date();
var event = new Date("Mar 6 2007 09:00:00");
var seconds = (event - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update() {
now = new Date();
seconds = (event - now) / 1000;
seconds = Math.round(seconds);
minutes = seconds / 60;
minutes = Math.round(minutes);
hours = minutes / 60;
hours = Math.round(hours);
days = hours / 24;
days = Math.round(days);
document.form1.hours.value = hours;
document.form1.minutes.value = minutes;
ID=window.setTimeout("update();",1000);
}
// --></script>
</head>
<body>
<form name="form1" method="post" action="">
<strong><font face="Century Gothic">Hours
<input type="text" name="hours" value="0" size="2">
Minutes
<input type="text" name="minutes" value="0" size="2">
</font></strong>
</form>
<p> </p>
</body>
</html>