url from a menu option

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
RMV
New User
Posts: 12
Joined: Wed Jan 19, 2011 3:42 pm
First Name: Roderic
Last Name: Vosburgh
Company Name: McGard
City: Orchard Park
State / Province: New York
Zip / Postal Code: 14127
Country: United States
Contact:

url from a menu option

Post 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
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: url from a menu option

Post 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);

RMV
New User
Posts: 12
Joined: Wed Jan 19, 2011 3:42 pm
First Name: Roderic
Last Name: Vosburgh
Company Name: McGard
City: Orchard Park
State / Province: New York
Zip / Postal Code: 14127
Country: United States
Contact:

Re: url from a menu option

Post by RMV »

Thank you, that is what I needed. It's working now.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests