Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

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()
}


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=;");
}



HTH,
Andy


Poster: himred
Dated: Tuesday January 9 2007 - 19:49:35 GMT

Thanks a lot Andy , you are very efficient as usual .

It's done and working .

I won't ask you why this is working ;)

Best regards,

Himred


Poster: Andy
Dated: Tuesday January 9 2007 - 21:40:07 GMT

Quote:
I won't ask you why this is working


It's a little bit of voodoo 8)

Glad you got it working

Cheers,
Andy