L
linuxnooby
This is a simple question but it is doing my head in
all i want is a form text field to be focused when the page loads.
Works in IE6 but not in Firefox 1.6
<body >
<form action="testfocus.htm" method="post" name="test" id="test" >
<input type="text" name="name" id="name"
onLoad="this.forms[0].elements[0].focus()">
<input type="submit" name="submit">
</form>
</body>
I tried variations like
onLoad="this.forms["test"].elements["name"].focus()"
onLoad="this.getByElementId["name"].focus()"
onLoad="this.test.name.focus()"
these all work in IE but not Firefox!!! I need to have the onload event
in the form tag because the body tag is part of an include that is
common to other pages.
help!!!!!!!!!!!!!!!!!!!!!!!!!!
dave
all i want is a form text field to be focused when the page loads.
Works in IE6 but not in Firefox 1.6
<body >
<form action="testfocus.htm" method="post" name="test" id="test" >
<input type="text" name="name" id="name"
onLoad="this.forms[0].elements[0].focus()">
<input type="submit" name="submit">
</form>
</body>
I tried variations like
onLoad="this.forms["test"].elements["name"].focus()"
onLoad="this.getByElementId["name"].focus()"
onLoad="this.test.name.focus()"
these all work in IE but not Firefox!!! I need to have the onload event
in the form tag because the body tag is part of an include that is
common to other pages.
help!!!!!!!!!!!!!!!!!!!!!!!!!!
dave