Can someone resolve my issue with using the focus() attribute of an input in an onLoad handler? (not directly in the handler, but in a function called from the handler) It doesn't seem to work, but I may be wrong. Here's the basic code, minus a whole bunch of
php. I'd link you to the website if it existed. I'm running this off my computer for testing.
- HTML: Select all
<html>
<body>
<form name="mainform" method="post">
<script language="javascript">
<!--
function give_focus_answer()
{
document.mainform.answer.focus();
}
-->
</script>
<table align="center" valign="middle" width="300">
<tr><td>Score: : % </td></tr>
<tr><td><input type="text" readonly width="100" name="word" value="" /></td></tr>
<tr><td><input type="text" name="answer" width="100" onLoad="give_focus_answer();" /></td></tr>
<tr><td><input type="submit" name="submit" width="30" value="Submit" />
<input type="submit" name="start" width="30" value="Start" /></td></tr>
</table>
</form>
</body>
</html>