please help write a javascript function to do a client side validation of the html form i have displayed below.
the validation should check if input box Student No cannot be empty; if the txtStdNo box is empty there should be a message "Cannot be empty" and move the cursor to the txtStdNo input box.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form name='frm1' method="post" action="student.php">
Student No <input type="text" name='txtStdNo' /> <BR />
Name <input type="text" name='txtName' /> <BR />
Address <input type="text" name='txtAdd' /> <BR />
Contact No <input type="text" name='txtTel' /> <BR />
<input type="submit" name="cmdDelete" value="Delete" />
<input type="submit" name="cmdRetrieve" value="Retrieve" />
<input type="submit" name="cmdUpdate" value="Update" />
<input type="submit" name="cmdClose" value="Close" />
</form>
</body>
</html>
please help write HTML code to attach the javascript function to the form. form should not be submitted if STDNO box is empty.
HOW DO YOU DO THIS???
THANK YOU