Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:44
Help required on setting focus on a menu form item
Poster: himred
Dated: Tuesday January 9 2007 - 10:15:47 GMT
Hi !
on my web site http://www.l2wh.com i use milonic menus (framed version) and everything works great .
If you select the 'FastSearch' item of the top menu of the site,you'll get a simple formular with a text field .
Now, I'm trying to set the focus to that text field when the menu is opened .
I tryed onfunction,clickfuntion with something similar to top.document.getelementbyid["q"].focus(); but that does not seems to work .
Any help is welcome .
Thanks !
Himred
Poster: Andy
Dated: Tuesday January 9 2007 - 18:55:27 GMT
Hi,
This should do it
Code:
function mmVisFunction(_mD,v){
if(_m[_mD][1]=="search")_d.forms['fs'].q.focus()
}
if(_m[_mD][1]=="search")_d.forms['fs'].q.focus()
}
What you need to do is put this inside the framemenu.js file, probably best just before the search menu like this:
Code:
function mmVisFunction(_mD,v){
if(_m[_mD][1]=="search")_d.forms['fs'].q.focus()
}
with(milonic=new menuname("search")){
style=SearchStyle;
margin=0;
border=0;
bordercolor="#331155";
aI("text=<FORM METHOD=GET ACTION=/woogle.php name=fs><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td align=center><b>Fast L2WH Search</b><br><br><input id=q name=q type=text><br><br><input type=submit value=Search></td></tr></table></form>>;type=form;align=center;onbgcolor=;onborder=;");
}
if(_m[_mD][1]=="search")_d.forms['fs'].q.focus()
}
with(milonic=new menuname("search")){
style=SearchStyle;
margin=0;
border=0;
bordercolor="#331155";
aI("text=<FORM METHOD=GET ACTION=/woogle.php name=fs><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td align=center><b>Fast L2WH Search</b><br><br><input id=q name=q type=text><br><br><input type=submit value=Search></td></tr></table></form>>;type=form;align=center;onbgcolor=;onborder=;");
}
HTH,
Andy