Page 1 of 1

url from a menu option

Posted: Mon Mar 05, 2012 10:14 am
by RMV
I am trying open a url from a menu option using javascript.
The url's are loaded into the value portion of the menu.

I tried the script: window.open(get("DocPath")); DOCPATH IS THE RECORD ID.

I tried using it in the ONOPTIONSCLICK properity and when that didn't work tried it in the ONCLICK property. Both give me an invalid argument error.

I loaded a url from one of the menu values into a hyperlink widget and the script:
window.open(get("linkid")); works fine.

How do I get this to work from a menu option.
Debug shows the correct url is being loaded into the menu value properities.

Thanks

Re: url from a menu option

Posted: Mon Mar 05, 2012 8:09 pm
by David
Are you referring to the menu widget?

If so, you'll want to use the "onoptionclick" event of the menu widget. A special variable called "value" is available to your script that will have the value of the option clicked. Variable "text" will include the text. See here:

http://www.profoundlogic.com/docs/displ ... %28Menu%29

In your case, assuming the URL is in the menu option value, you could use this:

Code: Select all


window.open(value);


Re: url from a menu option

Posted: Tue Mar 06, 2012 2:52 pm
by RMV
Thank you, that is what I needed. It's working now.