programmher
Programmer
Here is what I'm TRYING to do:
If today's date is less than or equal to 5, proceed to the next web page and allow the user to continue with their entries.
If today's date is greater than 5 (does not meet the first condition), display a message and redirect them to the home page.
Below is my code. It does not work the way it should. Can anyone tell me why and how I can debug it?
<SCRIPT LANGUAGE="JavaScript">
transfer_location = "Home.cfm";
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
var today=new Date();
var todayy=today.getYear();
if ((navigator.appName == "Microsoft Internet Explorer" && (todayy < 3000))
todayy="20" + todayy;
if (navigator.appName == "Netscape"
todayy=2000 + todayy;
var todaym=today.getMonth();
var todayd=today.getDate();
var todaystring=montharray[todaym]+" "+todayd+", "+todayy;
if (todayd <= 5)
document.location.href = "Input.cfm";
else
alert("Sorry! You can only access this page the first five days of the month. You will be returned to the Home page."
document.location.href = "Home.cfm";
If today's date is less than or equal to 5, proceed to the next web page and allow the user to continue with their entries.
If today's date is greater than 5 (does not meet the first condition), display a message and redirect them to the home page.
Below is my code. It does not work the way it should. Can anyone tell me why and how I can debug it?
<SCRIPT LANGUAGE="JavaScript">
transfer_location = "Home.cfm";
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
var today=new Date();
var todayy=today.getYear();
if ((navigator.appName == "Microsoft Internet Explorer" && (todayy < 3000))
todayy="20" + todayy;
if (navigator.appName == "Netscape"
todayy=2000 + todayy;
var todaym=today.getMonth();
var todayd=today.getDate();
var todaystring=montharray[todaym]+" "+todayd+", "+todayy;
if (todayd <= 5)
document.location.href = "Input.cfm";
else
alert("Sorry! You can only access this page the first five days of the month. You will be returned to the Home page."
document.location.href = "Home.cfm";