Your specific example works for me, but if I add another field with the same name:
<input type="text" name="keyword1" />
<input type="text" name="keyword1" />
Then it document.adv_search.keyword1.focus()will fail with the error you specified.
The reason is that:
document.adv_search.keyword1
is a shortcut for this syntax (which returns to DOM Level 0 and Netscape 2 days!):
document.forms.adv_search.elements.keyword1
(, , , : HTMLDocument HTMLFormElement, , . , document.forms form.elements. , IE "", , id="adv_search" , document.adv_search .)
, DOM Level 0 , , . , . , , , . focus() select() , ; - keyword1 [0].focus(), .
, , DOM 0 - - , ID, "DOM Level 1:
document.getElementById('keyword1').focus();
, ID, , ( script , , ), . ( name <form> .)