what I'm trying to do is if the username is blank then have it alert them to fill it in and give it focus...[THIS WORKS]

but then, I also want it to check the password and make sure it's not null and if it is have it tell them to fill it out and give IT focus.


Code:
 
<%@LANGUAGE="JAVASCRIPT"%>
<%
Session("HandHeldObject")= null
Session("HandHeldObject")= Server.CreateObject("HandHeldItemMaint.HandHeldATL");
Session.Timeout = 300 //5 hours  
var objHandHeld = Session("HandHeldObject");
if (Session("HandHeldObject").Open() == false){ 
%>
<script language="JavaScript">
alert("ERROR: " + "<%=objHandHeld.ErrorMessage%>"); 
</script>
<%
} //<--FROM ABOVE IF
%>
<html>
<head>
<title>Hand Held Logon</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function validate() { 
if( (document.formhandheld.username.value.length <=0) || 
(document.formhandheld.username.value == "") )
 { 
  alert("Enter a usernumber"); 
 document.formhandheld.username.focus(); 
 
 
  var authenticate = true; 
  
   if (authenticate == true) { 
	return false; 
   } 
   else { 
  return true; 
  } 
 } 
}
</script>
</head>
<body bottommargin="0" topmargin="0" rightmargin="0" leftmargin="0">
<!--code to stop keypad from coming up /  DOESNT WORK -->
 <OBJECT ID="txtNoSIP" CLASSID="clsid:A72D105-40C2-11D6-918E-00C0DF232EEE" width="95" height="20">
  <PARAM NAME=VALUE VALUE="">
  <PARAM NAME=MAXLENGTH VALUE=30>
  <PARAM NAME=ALIGNMENT VALUE=LEFT>
 </OBJECT>
 <SCRIPT language="JavaScript" FOR="txtNoSIP" EVENT="OnFocus()">txtNoSIP.ShowSIP(false);</SCRIPT>
 <SCRIPT language="JavaScript" FOR="txtNoSIP" EVENT="OnLostFocus()">txtNoSIP.ShowSIP(false);</SCRIPT>
<form name="formhandheld" action="pocketLogInProcess.asp" method="post" onSubmit="return validate()"> 
<table width="225" height="320" border="0" cellpadding="0" cellspacing="0">
  <tr>
	<td bgcolor="#e3e3e3" valign="top">
 <table width="100%" height="320" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td bgcolor="#e3e3e3" height="*" valign="top">
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
	 <td colspan="2" align="center" bgcolor="#00CC33">
	 <font size='-1' face='verdana,arial'><%=objHandHeld.ItemTitle%></font>
	 </td>
	 </tr>
	 <tr>
	  <td>&nbsp;</td><td>&nbsp;</td>
	 </tr>
   <tr>
	  <td colspan="2"><font face='verdana,arial'>Please Sign On</font></td>
	 </tr>
	 <tr>
			<td><font face='verdana,arial'>User Number:</font></td>
   <td align="right"><input name="username" type="text" size="15" maxlength="9"></td>
	 </tr>
	 <tr>
	  <td height="19" ><font face='verdana,arial'>Password:</font></td>
			<td align="right"><input name="password" type="password" size="15" maxlength="4"></td>
	 </tr>
			  </table>
   </td>
		</tr>
		<tr>
		  <td bgcolor="#999999" height="28"><div align="center">
			  <input type="submit" name="OK" value="&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;">
	   <input type="reset" name="Cancel" value="&nbsp;&nbsp;Cancel&nbsp;&nbsp;">
	 <input type="button" name="Help" value="&nbsp;&nbsp;&nbsp;Help&nbsp;&nbsp;&nbsp;" onClick="window.location.href="pocketLogin_Help.asp"">
			</div></td>
		</tr>
	  </table></td>
  </tr>
</table></form>
</body>
</html>