cant find the error

Status
Not open for further replies.

CrazyRomanian

Baseband Member
Messages
45
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.
 
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.
 
Try a semicolen after that line it is complaining about, since you entered a new line and ended with a bracket.
 
Status
Not open for further replies.
Back
Top Bottom