copy to clipboard and stay on site
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2017 06:14 AM
Hi everyone,
I hope you guys can help me :S
I made a new UI-Action for the context menu. I need to copy information generated by a JS to the clipboard. I try it by using window.prompt("Copy to clipboard: Ctrl+C, Enter", someGeneratedText);.
My problem is, at first, the promt window doesn't show up. Also I want it to stay at the current page (it always jumps back to the previous page).
Kind Regards
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2017 06:20 AM
Can you share the UI Action script here?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2017 06:25 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2017 06:29 AM
OK, I think I see it - you have client side code (window.prompt) and server code together.
By default, UI actions run server code only unless you click the client checkbox, then you need to tell it which function to run on click, write your client code in that function, and optionally call the server code. Here's a good reference and example how to do that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 01:06 AM
Thank you for your help Chuck. It worked out with the checkbox...somehow. Is it possible to call a script of script include in a (Client) UI Action??