function formSubmit(){ var length; var d = document.Example; length = d.userName.value.length(); if(length < 1){ alert("Please Key in UserID"); d.userName.focus(); return false; } length = d.userPassword.value.length(); if (length <1){ alert("Please Key in Password"); d.userPassword.focus(); return false; } }
<table> <tr> <td><input Name="userName" size="10" maxlength="20" type ="text" onkeypress="checkKeyPress();" onBlur="UpperCase(this);"></td> </tr> <tr> <td><input name="userPassword" type="password" size="20" maxlength="20" onkeypress="checkKeyPress();" ></td> <td><div><img src="images/iconlogon.gif" onClick="formSubmit();" style=cursor:hand;></div></td> </tr> </table>
y cant i click it and it is not function?
anybody can give me some guide?