I am unable to have the "null" value working for the validation of the
text field.
The code is able to validate if the sid value is having one,two,three
spaces....but not more..it is sloppy coding...but it works....any
pointers to improve the code.
sid = document.form1.StudentID.value;
if (sid.length == 0 || sid == " " || sid ==" " || sid ==" " || sid
==" ")
{
alert("Student ID is Missing " + sid);
return false;
But when I am using, the sid is accepting values. with spaces.
if (sid.length == 0 || sid == null)
{
alert("Student ID is Missing " + sid);
return false;
}