can someone give me the general structure of the code to the setfocus function in javascript? I need to set the focus to a specific field in a form and can't figure it out. thanks
<script language="JavaScript"> <!-- document.formname.fieldname.focus(); // --> </script>
Craig, go to http://stonemountain.yi.org/ and view source for an example. Note that you have to give the form a name. The script at the bottom of the page actually sets the initial focus. There is inline code in the form itself to facilitate tabbing and automatic submission.
Steve - I tried yours first and it didn't work - can't figure out why though. Then I tried Steve Y's and it worked.
Steve- I tried Steve D's first and it didn't work, but your method did. Now I can't view the source of my own page though, any idea why?
This needs to be after the form.