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:34

Search form in menu hides dropdown select box


Poster: e-spike
Dated: Thursday August 25 2005 - 18:23:24 BST

I know it is possible to use a search form box within the menu, and this works fine in your demonstrations on your homepage etc. My site needs to use this feature but with a drop down box, not a text field. How can i stop the menu from hiding everytime something is selected from the drop down box?

thanks

Rich


Poster: John
Dated: Thursday August 25 2005 - 22:16:46 BST

URL??


Poster: e-spike
Dated: Thursday August 25 2005 - 22:23:43 BST

http://newcom.serran.net login sserra / leandra then search on the milonic menu


Poster: John
Dated: Monday August 29 2005 - 16:10:57 BST

404.


Poster: e-spike
Dated: Monday August 29 2005 - 17:16:45 BST

Quote:
404
Sorry someone else was working on that box and somehow the connection string was overwritten,

this situation has now been fixed, please take another look

Rich


Poster: kevin3442
Dated: Monday August 29 2005 - 20:51:12 BST

Hi Rich,

I just went to the URL and tried to log in. The provided username/password didn't work.

I know that you didn't ask for site critiques, but I gotta say that, IMHO, I found the javascript that the login page uses to close opener windows to be a little... um... off putting. The worst part is that, because it replaces the opener with itself, hence re-running the script, it can work it's way back to the original opener. In IE, instead of opening in a new (fourth) window to the login page, which is what I wanted, it closed two of my browser windows and replaced the original starting window with itself. As a result, I completely lost my starting point (in this case, on the forums). It does the same thing with the tabs in Opera 8; closed all of them back to my starting tab, then replaced the content in that tab with itself. Firefox resists a litte, closing only partway back to the original. For people like me, who prefer to open a link in a new window or tab (shift-click), that behavior isn't ideal. I imagine it could irritate many of your users. Just my opinion, FWIW.

Cheers,

Kevin


Poster: e-spike
Dated: Monday August 29 2005 - 20:55:42 BST

please try#
username:sserra
password:tester

I have fixed the js issue - i see what you mean and i have a workaround in development, thanks for the heads up


Poster: kevin3442
Dated: Monday August 29 2005 - 21:16:17 BST

Hi Rich,

As a quick solution, try setting keepalive=1; in your "search" menu. If that doesn't work the way you want, it may take something more involved.

Thanks for commenting the opener closing code out. Might be a temporary thing I know, but it made my trip easier!

Cheers,

Kevin


Poster: e-spike
Dated: Monday August 29 2005 - 21:24:36 BST

i'm assuming the keepalive=1 is immediatly after the menu decleration (the bit which reads:
with(milonic=new menuname("search"){
keepalive=1
margin=2
...
) is this correct?


Poster: e-spike
Dated: Monday August 29 2005 - 21:27:32 BST

Now how do i close a named menu?


Poster: kevin3442
Dated: Monday August 29 2005 - 21:31:06 BST

e-spike wrote:
i'm assuming the keepalive=1 is immediatly after the menu decleration (the bit which reads:
with(milonic=new menuname("search"){
keepalive=1
margin=2
...
) is this correct?

Yep, that spot will work. Menu properties can actually be defined anywhere between the opening
Code:
with(milonic=new menuname("search")){
and the first
Code:
aI("text= ... ;");

The order in which they are defined does not matter.

Cheers,

Kevin


Poster: kevin3442
Dated: Monday August 29 2005 - 21:51:25 BST

e-spike wrote:
Now how do i close a named menu?


Hmmmm... looks like I'm a step behind!

Here are some functions that I have used to manipulate menu visibility programatically:

Code:
function mm_closeMenuByName(menuName) // , alwaysVisState = optional. 1=on, 0=off
{
  var menuNum = getMenuByName(menuName);
  if (arguments.length > 1) _m[menuNum][7] = arguments[1];
  menuDisplay(menuNum, 0);
}

You'll note that the function accepts an optional second parameter, which can be used to manipulate a menu's alwaysvisible property; 0 or false to disable alwaysvisible, 1 or true to enable. Of course, if you like, you can remove that portion of the function.

Also, I'm sure you can figure it out from the above, but I use the following to open a menu by name:
Code:
function mm_openMenuByName(menuName) // , alwaysVisState = optional. 1=on, 0=off
{
  var menuNum = getMenuByName(menuName);
  if (arguments.length > 1) _m[menuNum][7] = arguments[1];
  menuDisplay(menuNum, 1);
}

Same thing for the optional alwaysvisible flag (handy for opening a menu and leaving it open, which could be a viable alternative in your specific form/menu case).

I have also combined these two into a general "toggle" function, as shown below:
Code:
function mm_toggleMenuByName(menuName, menuState) // , alwaysVisState = optional. 1=on, 0=off
{
  var menuNum = getMenuByName(menuName);
  if (arguments.length > 2) _m[menuNum][7] = arguments[2];
  menuDisplay(menuNum, menuState);
}

For the menuState parameter, pass 0 to close the named menu or 1 to open it. Again, the function has an optional third parameter to set the alwaysvisible flag. Sometimes I like this toggle function better; other times I prefer the two separete functions.

Hope those helps... cheers,

Kevin


Poster: e-spike
Dated: Monday August 29 2005 - 22:11:08 BST

Thank you very much, you have been a great help

:)
SP!KE


Poster: kevin3442
Dated: Monday August 29 2005 - 22:25:48 BST

You're welcome. You've put together a nice-looking menu system. I hope these couple of tweaks help you get it running just the way you want.

Cheers,

Kevin