In the login page i have username and password ....as soon as the page is opened my cursor is not pointing towards the username field...but i want it to happen as soon as my login page is loaded...can this be done??
i tried to do as below...
Code: Select all
<script language="text/javascript">
function func1()
{
document.f1.user[user1].focus();
}
</script>
<form name="f1" onload="func1()">
<input type="text" name="user[user1]" >
<input type="password" name="pass1">
</form>
i identified that the problem is with the text box name (user[user1])...it is not taking the square brackets...if i change the text box name to normal name as "user" then its working fine....but me giving the name as user[user1] is important in my code....so, can i have a better solution to solve this problem..
Thanking you in advance