the user is taken down to the form whenever page is opened
I suppose this is how it will work on focus always. You can't set the focus without moving to the form itself.
This code also should be pasted below the form
. Also I would prefer to refer to document.forms['...'].elements['...']
, or may be you should experiment with "id"/"name" tags of the form, if any of those tags is missing, you may try to add it.