I have a menu with type=html, and that menu has one input space. When the menu opens, I would like to set the input focus to that input space, so that the user already has the cursor blinking in it without having to click it.
I cannot find an "openfunction" property that would fire when the menu first opens (like the "load" attribute on the <body> tag). If there were such a property, I presumably could set that property to "document.form.textelement.focus()".
Anyone have a clue how to do this?
Thanks!
How do I set input focus in an HTML menu?
You could do it with a timed function, something like this:
function setFocus()
{
setTimeout("document.forms.search.q.focus()",100);
}
Assuming a form object named "search" and a text box called "q"
Called from the parent menu item with an onfunction embedded inside the aI string, like this:
aI("url=/search.php;text=Search;showmenu=mm search;onfunction=setFocus()");
Hope this helps
Andy
function setFocus()
{
setTimeout("document.forms.search.q.focus()",100);
}
Assuming a form object named "search" and a text box called "q"
Called from the parent menu item with an onfunction embedded inside the aI string, like this:
aI("url=/search.php;text=Search;showmenu=mm search;onfunction=setFocus()");
Hope this helps
Andy