Calling JavaScript functions

Thought I would repost this with a bit more info…

I am evaluating OpenCube’s Visual QuickMenu Pro (opencube.com domain name is for sale. Inquire now.).

I am attempting to call JavaScript functions (such as “document.submit()”) into the “URL” (or link) field in this menu creator.

When creating a menu in this tool, it needs an “onclick” event which is basically a URL link - the field where you enter this info is called “URL:” and the default text in the field is “http://”.

I have tried placing:

“javascript:document.submit()” and “submit()”

into this “URL” field, but cannot get it to work.

I would like to call a JavaScript function from that menu item’s onclick event - not use a URL and move to another page.

Here is the function (OpenCube’s code) that sets up the onclick event:

function q32(index){

eval(eval("window.dqm__clickitem_code"+index));

if(!eval("window.dqm__url"+index))return;

if(eval("window.dqm__urltarget"+index))where=eval("dqm__urltarget"+index);

else where=dqm__urltarget;

if(where.length<1 || where.toLowerCase()=="_self")window.location.href=eval("dqm__url"+index);

else {

	if(where.toLowerCase().indexOf("_parent")>-1)eval("parent.window.location=dqm__url"+index);

	else if(where.toLowerCase().indexOf("_new")<0)eval("parent."+where+".location=dqm__url"+index);

	else window.open(eval("dqm__url"+index));

}

};

Here is the code that calls this function - it is setting the “onclick” event for the menu item:

onclick="q32(‘“+i+”’)"

The “index” (and “i”) parameter is basically the index of the menu item, such as Menu item 1, sub-item 4, would be “1_4”. Each item’s URL is defined like this:

dqm__url1_0_2 = vqm__database+“AuditPersonnelWeekly?OpenView” (vqm__database is set to ‘’ in the Form’s HTML Head Content property, where I set up this menu)

My question is: what do I have to do to make the “onclick” event just call a JavaScript function? I know there is some customization involved, which I think I can handle, I just need to syntax of what to place in this “URL” field.

I think I would just check to see if the “dqm__url” variable contained “?” or not, as an example, and from there I would format the onclick event’s text, right???

Thanks!

Dan

Subject: Calling JavaScript functions…

You should be submitting the form, not the document:

document.form[0].submit();