Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-19-2005, 09:32 PM   #1 (permalink)
 
Newb Techie

Join Date: Mar 2005

Posts: 45

CrazyRomanian

Default cant find the error

This is a piece of script that i have to do for a school profect about learnin java. Make a login screen where a user has to input usename and password, if correct the popup box correct appears, if not it says try again

<script LANGUAGE = "JavaScript">
<!--
function passcheck() {
var e = 0;
var u = 0;
var z = 0;
var final = 0;
var Pass = (Form1.Pass.value);
var User = (Form1.User.value);
if (User = 16878) {
u = 1 + u}
if (Pass = 1234) {
e = 1 + e ------------ this is the line that IE is complaining about
}
u + e = z;
if (z == 2) {
alert ("correct");
}
else {
alert ("wrong");
}
}
//-->
</script>

could someone plz help me becuase i dont know where i am going wrong.
__________________
Pain is just weakness leaving the body
CrazyRomanian is offline  
Old 03-20-2005, 06:38 PM   #2 (permalink)
 
Ultra Techie

Join Date: Oct 2003

Posts: 544

fitzjj

Default

Java and JavaScript are two completely different things. This is JavaScript not Java! anyway...

Without the full source code i cannot run it and see if it works and i normally code Java not JavaScript so cannot garantee any of this solution, but...

Code:
if (Pass = 1234) {
should probably be:
Code:
if (Pass == 1234) {
You may also want to try putting " around the 1234

also in the body of your first two if statements there are no semicolons at the end of the line.
fitzjj is offline  
Old 03-20-2005, 07:20 PM   #3 (permalink)
 
Monster Techie

Join Date: Sep 2004

Posts: 1,447

Alex81388

Send a message via AIM to Alex81388
Default

Try a semicolen after that line it is complaining about, since you entered a new line and ended with a bracket.
__________________
Sig removed due to foul language. Please read the rules regarding the allowable content of sigs before reposting your COMPLIANT sig.
~Trotter
4/21/06
Alex81388 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On