Field Validation using Javascript
Hi I need help. I can't get this to work. Any help will be highly appreciated.
I have this HTML and JS on the body of the web page:
--------------------------------------
<form method="post" action="main.ASP?WCI=Main&WCE=SubmitNonconformance &WCU=s%3dO2CFJ98YN9LV7R6UYC972AFMROX0AW40" name="Issue1">
<INPUT NAME="StandardText026" type="TEXT" size="20" MAXLENGTH="50"></td><td bgcolor="#FFFFFF"><font face="Verdana" size="-2" color="#000000"><b>Part No. Rev.</b>
<SCRIPT FOR = "SUBMIT" EVENT = "onclick">
IF ((document.Issue1.StandardText026.Value.length==0) ||(document.Issue1.StandardText026.Value==NULL))
{
ALERT ("Please fill-up the Part No. Field.");
document.Issue1.StandardText026.focus();
RETURN false;
}
</SCRIPT>
PLease help. What is wrong with my JS? I expect the alert box to come up when the field is empty.
Thanks!
|