Author |
Message |
Amy_Raye
Junior WebHelper
Joined: 20 Mar 2004
Posts: 3
Location: Pennsylvania
|
Posted:
Sat Mar 20, 2004 8:21 pm (20 years, 1 month ago) |
|
Hey, when I run this script it tells me that I'm missing a ; in line 4 and an expected ( in 47/48. I don't know what this script wants, I've checked it over and all of the bits seem to be there. Any help would be great. (Also in the preview there seems to be a emoticon with sunglasses where there should be an 8. )
Code: | <html><head><title>amy</title>
<script language="JavaScript">
function valid(){
Var x;
x=document.datecount;
if (((x.month=01) || (x.month=03) || (x.month=05) || (x.month=07) || (x.month=08) || (x.month=10) || (x.month=12)) && ((x.day >= 1) || (x.day <=31)))
{
window.alert("Date Valid");
}
else
{
WINDOW.ALERT("INVALID DATE");
}
if ((x.month=02) && ((x.day >= 1) || (x.day <=29)))
{
window.alert("Date Valid");
}
else
{
WINDOW.ALERT("INVALID DATE");
}
if (((x.month=04)|| (x.month=06)|| (x.month=09)|| (x.month=11)) && ((x.day >= 1) || (x.day <=30)))
{
window.alert("Date Valid");
}
else
{
WINDOW.ALERT("INVALID DATE");
}
}
</SCRIPT>
</head>
<body>
<form name="datecount" method="post" action="">
<P>Insert a date here to find the days remaining in 2004:</P>
<P>Example: 01/01/2004
<input type="text" name="month">/
<input type="text" name="day">/2004
<input type="Submit" name="valid" value="valid" onclick="valid()">
</P>
</form></body></html> |
|
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Sun Mar 21, 2004 9:32 am (20 years, 1 month ago) |
|
Well the smiley with the shades was because of the 8) which is the code for that particular smiley. You can get round that by putting code within the [code] tags, which I have done for you. |
|
|
|
|
SfCommand
Senior WebHelper
Joined: 10 Nov 2002
Posts: 143
Location: UK
|
Posted:
Sun Mar 21, 2004 6:42 pm (20 years, 1 month ago) |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Mar 21, 2004 7:25 pm (20 years, 1 month ago) |
|
Yes, it would, but
|
________________________________
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Mar 21, 2004 7:31 pm (20 years, 1 month ago) |
|
Maybe the capital letter in "Var" is the problem. I changed that and my browser threw up some other errors, leading me to think that at least that problem had disappeared...
The errors were:
Quote: | Warning: 08 is not a legal ECMA-262 octal constant
Source File: http://www.4webhelp.net/test.php
Line: 117, Column: 78
Source Code:
if (((x.month=01) || (x.month=03) || (x.month=05) || (x.month=07) || (x.month=08) || (x.month=10) || (x.month=12)) && ((x.day >= 1) || (x.day <=31))) |
Quote: | Warning: 09 is not a legal ECMA-262 octal constant
Source File: http://www.4webhelp.net/test.php
Line: 135, Column: 44
Source Code:
if (((x.month=04)|| (x.month=06)|| (x.month=09)|| (x.month=11)) && ((x.day >= 1) || (x.day <=30))) |
|
________________________________
|
|
|
|
Amy_Raye
Junior WebHelper
Joined: 20 Mar 2004
Posts: 3
Location: Pennsylvania
|
Posted:
Sun Apr 18, 2004 5:21 am (20 years ago) |
|
Thanks for all the help, even with the silly emoticon! |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Apr 18, 2004 8:17 am (20 years ago) |
|
Was your problem solved? |
________________________________
|
|
|
|
Amy_Raye
Junior WebHelper
Joined: 20 Mar 2004
Posts: 3
Location: Pennsylvania
|
Posted:
Mon May 03, 2004 1:44 am (19 years, 11 months ago) |
|
Yes it was! Thanks again to everyone |
|
|
|
|
|
Page generation time: 0.125078 seconds :: 18 queries executed :: All Times are GMT
Powered by
phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme