I'm trying unsuccessfully to use a variable in a script that changes focus.
Depending on which link a user follows (navigates via keyboard or
clicks), I'd like to change the focus to an input name="q" in different
forms on the page.
<A onClick="change Focus('basicsea rch')"
HREF="#basic">b asic site search</A>
<A onClick="change Focus('advanced search')"
HREF="#advanced ">advanced site search</A>
The script I have is:
function changeFocus(cat egory) {
document.'(cate gory)'.q.focus( );
return false;
}
It doesn't work. I'm not sure how to insert the parameter into the focus
statement. What am I doing wrong?
--
Brian (remove "invalid" from my address to email me)
Depending on which link a user follows (navigates via keyboard or
clicks), I'd like to change the focus to an input name="q" in different
forms on the page.
<A onClick="change Focus('basicsea rch')"
HREF="#basic">b asic site search</A>
<A onClick="change Focus('advanced search')"
HREF="#advanced ">advanced site search</A>
The script I have is:
function changeFocus(cat egory) {
document.'(cate gory)'.q.focus( );
return false;
}
It doesn't work. I'm not sure how to insert the parameter into the focus
statement. What am I doing wrong?
--
Brian (remove "invalid" from my address to email me)
Comment