4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 JavaScript problems
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Amy_Raye
Junior WebHelper
Junior WebHelper


Joined: 20 Mar 2004
Posts: 3
Location: Pennsylvania

PostPosted: Sat Mar 20, 2004 8:21 pm (20 years, 1 month ago) Reply with QuoteBack to Top

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>
OfflineView User's ProfileFind all posts by Amy_RayeSend Personal MessageAOL Instant Messenger
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Sun Mar 21, 2004 9:32 am (20 years, 1 month ago) Reply with QuoteBack to Top

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.
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
SfCommand
Senior WebHelper
Senior WebHelper


Joined: 10 Nov 2002
Posts: 143
Location: UK

PostPosted: Sun Mar 21, 2004 6:42 pm (20 years, 1 month ago) Reply with QuoteBack to Top

Also, by clicking the "disable smily's in this post" checkbox, surely that would also work? Very Happy

________________________________
Miguel

http://community.34sp.com
http://www.miguel.me.uk | http://www.sfcommand.co.uk | http://www.ssdg.org.uk
OfflineView User's ProfileFind all posts by SfCommandSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun Mar 21, 2004 7:25 pm (20 years, 1 month ago) Reply with QuoteBack to Top

Yes, it would, but

Image

Razz

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun Mar 21, 2004 7:31 pm (20 years, 1 month ago) Reply with QuoteBack to Top

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)))

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Amy_Raye
Junior WebHelper
Junior WebHelper


Joined: 20 Mar 2004
Posts: 3
Location: Pennsylvania

PostPosted: Sun Apr 18, 2004 5:21 am (20 years ago) Reply with QuoteBack to Top

Thanks for all the help, even with the silly emoticon! Wink
OfflineView User's ProfileFind all posts by Amy_RayeSend Personal MessageAOL Instant Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun Apr 18, 2004 8:17 am (20 years ago) Reply with QuoteBack to Top

Was your problem solved? Smile

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Amy_Raye
Junior WebHelper
Junior WebHelper


Joined: 20 Mar 2004
Posts: 3
Location: Pennsylvania

PostPosted: Mon May 03, 2004 1:44 am (19 years, 11 months ago) Reply with QuoteBack to Top

Yes it was! Thanks again to everyone Very Happy
OfflineView User's ProfileFind all posts by Amy_RayeSend Personal MessageAOL Instant Messenger
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.207 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme