Hi I would like to know why this piece of code does not show an empty string alert like it should. I think I am not passing the text field variables correctly or something along those lines.
Help would be greatly appreciated
//Form PHP<SCRIPT language="JavaScript"><!-- function checkForm() { var err = ""; err += checkLogin();//check for empty string if (err != "") { alert(err); return false; }return true;}--></SCRIPT><Script language="javascript" src="validator.js"></Script></head>/*omit stuff*/<form id="Login" action="wel.php" name="frmLog"onsubmit="return checkForm();">/*omit stuff*/<td><input type="text" name="logID" id="logID" class="form250"></td>******************//validator.js// JavaScript Documentfunction checkLogin (){ var strng=document.frmLog.logId.value;//get log in txtfield var error=" "; if (strng == " ") { error = "Your Login ID must not be empty.\n"; } return error;}