The code is as follows:
<body><table><tr><td> Name: </td><td><input type= "text" name= "Truename" id= " Truename "/></td></tr><tr><td colspan=" 2 "><input type=" Submit "value=" Submit "onclick = "return check ();"/></td></tr></table></body><script language= "JavaScript" > function Check () {if (document.getElementById (' Truename '). value== ") {alert (' must enter a name! ‘); document.getElementById (' Truename '). focus (); return false; } if (document.getElementById (' identity '). value== ") {alert (' must enter ID number! ‘); document.getElementById (' Identity '). focus (); return false; } if (document.getElementById (' Tel '). value== ") {alert (' must enter a contact number! ‘); document.getElementById (' Tel '). focus (); return false; } if (document.getElementById (' address '). value== ') {alert (' must enter a contact address! ‘); document.getElementById (' Address '). focus (); return false; } if (document.getElementById (' PassWord '). value== ") {alert (' Password cannot be empty! ‘); document.getElementById (' PassWord '). Focus (); return false; } if (document.getElementById (' PassWord '). Value!=document.getelementbyid (' Rpass '). {alert (' Two input passwords are inconsistent!) ‘); document.getElementById (' PassWord '). focus (); return false; }}</script><script language= "JavaScript" >function Check () {if (document.getElementById (' Truename '). value== ') {alert (' must enter a name! ‘); document.getElementById (' Truename '). focus (); return false; } if (document.getElementById (' identity '). value== ") {alert (' must enter ID number! ‘); document.getElementById (' Identity '). focus (); return false; } if (document.getElementById (' Tel '). value== ") {alert (' must enter a contact number! ‘); document.getElementById (' Tel '). focus (); return false; } if (document.getElementById (' address '). value== ') {alert (' must enter a contact address! ‘); document.getElementById (' Address '). focus (); return false; } if (document.getElementById (' PassWord '). value== ") {alert (' Password cannot be empty! ‘); document.getElementById (' PassWord '). focus (); return false; } if (document.getElementById (' PassWord '). Value!=document.getelementbyid (' RP"). {alert (' Two input passwords are inconsistent!) ‘); document.getElementById (' PassWord '). focus (); return false; }}</script>
JS non-null verification