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: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:28

Dynamically flip checkbox beside menu …


Poster: hvilleneuve
Dated: Friday August 9 2002 - 17:28:48 BST

Hello,

There is what I want to do.
I have a boolean virable in javaScrit and I want to place a check box image beside a menu when this variable is true and no image when the variable is false.

I have some dynamic scripting stuff in my menu and every thing is working fine. I realise
that all the scripting tag in the menu definition is executed only once (in the dumpmenu i guess). I don’t understand the execution sequence of the menu and the purpose of the function dumpmenu.

How can I do that ?

here is my Sample :

------ My_menu_definition.js -----------
[...]
// My global variable.
var _checked = true;

// When I select the menu, the variable is flipped and the Checkbox image SHOULD flip
addmenu(menu=["debug",
,,100,1,"",prop1,,,menuTransition(),,,,,,,,,,,,
,"<script>test()</script>Voir Document","javascript:onClick=flip()",,,0
,"langue ...","show-menu=langue",,,0
])


function test()
{
if(_checked)
{
document.write("<img src=../js/menu/checked.gif border=0>&nbsp");
}
}

// Flip the check box variable !
function flip()
{
_checked = !_checked;
}

[...]