I’m maintaining a site in ASP, one of the tasks is to set the focus on textbox on a page. Here is what I have tried:
<script type="text/javascript">
<!--
document.psForm['password'].focus();
//AND
document.getElementById("password").focus();
-->
</script>
I didn't think this would work... and it doesn't:
<form id="psForm" action="logonpw.asp" method="post" defaultfocus="password">
This doesn't work:
<body onload="javascript:docuument.psForm.password.focus();">
Here is the form:
<form id="psForm" action="logonpw.asp" method="post">
<table border="0" cellpadding="5">
<tr>
<td>
Password:
</td>
<td>
<input type="password" name="password" value="<%= password %>" size="50">
</td>
</tr>
</table>
</form>