Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Whats wrong with this Javascript?


knighty - 5:15 pm on Oct 30, 2002 (gmt 0)


Someone please explain - why do I get a syntax error for the line where the else statement is?

just a simple script to check if a couple form fields are empty

<script>
function Check()
{
z = document.PersonalChange;

if ((z.EmployeeName.value == "") ¦¦ (z.PayrollNumber.value == ""));
{
alert('You need to enter your name');
return false;
}
else
{
alert('woohoo');
return true;
}
}
</script>

--for the form I have....

<form method=post action="success.html" name="PersonalChange" onSubmit="return Check();">

but i get an error before I get a chance to execute the form


Thread source:: http://www.webmasterworld.com/javascript/218.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com