Hey all!
I have a slight problem ... it isn't a very big problem, but enough for make me irritated about it being there 🙂
I have a PHP-file which includes 3 different pages. An introduction-page, a login-page and a "create profile" page.
The thing is that I want to have a form focus on the first field at both the login-page and the "create profile" page, but the introduction-page doesn't have any forms so therefore I don't need a form focus there.
I tried using the following code:
<body onload="document.forms[0].b_username.focus();">
Which also works fine on the login-page and the "create profile" page, but the browser gives me an error on the introduction-page withthis message:
Error: 'document.forms.0.b_username' is null or not an object
Anyone have any idea how I can make it easier so I will remain the form focus on 2 pages but remove it on the 3rd?
Thanx!