Please help me with my follwing code.
this can only check if username textbox is empty.
how do i also make it so that it checks if password textbox is empty and thereby give an error??? please help.
<html>
<script type="text/javascript">
function validateFormOnSubmit(strng){
if(strng.value=="")
{
alert("Empty");
return false;
}
else
{
return true;
}
}
</script>
</head>
<body>
<form onsubmit="return validateFormOnSubmit(textBox1);" method="post">
User Name <input type="text" name="textBox1" id="textBox1" /> <br>
Password <input type="password" name="txtPassword" /> <br>
<input type="submit" value="Ok" />
<input type="button" value="Cancel" />
</form>
</body>
</html>