Here is my javascript code for a cursor focus function to go to username if it is blank on a form call "login".
<script type = "text/javascript">
if (document.forms.login.user.value == "")
(
document.forms.login.user.focus();
)
else
(
document.forms.login.password.focus();
)
Do I need to add anything to my form? Here it is.
<form action="form.php" method="post" name="login">
<label for="user"><b>Username:</b></label> <input name="user" type="text" id="user" size="20"/><br/>
<label for="password"><b>Password:</b></label> <input name="password" type="password" id="password" size="20"/><br/>
<input type="hidden" name="action" value="login"/><br/>
<input type="submit" id="submit" value="Login"/>
</form>