Copy to clipboard

Questions regarding the authoring of Viewlets, installation or possible bugs with our products. For urgent issues, please use our support form on our website:
Posts: 4
Joined: Tue Mar 13, 2012 10:46 am

Copy to clipboard

Postby Ressem » Wed Mar 14, 2012 3:38 am


Im a novice when it comes to javascript so I need some help. I tried to make a javascript command, "on click" under button events, making it possible to copy text to clipboard. I do not know if it worked as the slide would not display after publishing the viewlet.

Java script code:


function ClipBoard()
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();


Is there a solution for this


Site Admin
Posts: 1092
Joined: Fri May 26, 2006 3:15 pm
Location: San Jose, CA

Re: Copy to clipboard

Postby James » Wed Mar 14, 2012 10:16 am


You don't include the HTML tags in your statements for the Events/Actions inside ViewletBuilder - just the Java code. See if that works for you. I will have a programmer look at your statements.

Site Admin
User avatar
Posts: 223
Joined: Fri May 26, 2006 1:51 pm
Location: Rochester, NY

Re: Copy to clipboard

Postby Andrew » Wed Mar 14, 2012 1:15 pm

When adding a JavaScript Action to the OnClick event of a button in ViewletBuilder, you do not need to create a function or add the javascript HTML tag. You just add the javascript as Jay mentioned.

So your case would look like this:

As for updating the clipboard from a browsers, this is quite complicated. Here is a website that might help you: ... avascript/
Andrew Branch

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest