variable to clipboard

mbuitenkamp-4316
Community Member Posts: 15 ☆ Roadie ☆
Hi all,
I'm looking for a way to copy the text from an entryfield to the clipboard, and combine it with a little bit of text of my own.
So, someone puts text in entryfield_1, that text gets stored in variable_1, and then with an onMouseClick I want that text and my own text copied to the clipboard, so it can be pasted into a document.
Any way of doing this?
Cheers in advance
I'm looking for a way to copy the text from an entryfield to the clipboard, and combine it with a little bit of text of my own.
So, someone puts text in entryfield_1, that text gets stored in variable_1, and then with an onMouseClick I want that text and my own text copied to the clipboard, so it can be pasted into a document.
Any way of doing this?
Cheers in advance

Comments
-
wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin TeamI've recently done something similar. I'm including an example that has a button and an entry field.
It puts content into the entry field using a Change Contents action, then it runs some JavaScript to copy it to the clipboard.
Hopefully it will be easy to understand, you need to Page Preview or Publish it for it to work.
- Joe
@mbuitenkamp.4316 (see the post below) -
-
wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin TeamIt was blank, not sure how that happened.
It also needed some updates, so it's a good thing. It will work on either Desktop or Online now.
Thanks
Joe -
awesome!! I got it to work in my document! Thank you!
but... (of course there's a but), I need the entryfield to be multiline since we're asking users to create a list.
that isn't a problem, until I paste the contents from the clipboard and the neat little list just ends up as one very long single line.
so this:
item 1
item 2
item 3
becomes this:
item 1item 2item 3
Can that be fixed??? -
edited to match my document, so you can see what's going on
-
-
okay, last question:
it works when the entryfield is single line, but it doesn't work when the entryfield is multiline
The variable gets set into the entryfield for copy, but in multiline the text doesn't get selected, and so it doesn't get copied.
Which is a shame because I really do need a multiline solution.
Any idea how to fix this?
tia -
wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin TeamHi Tia,
That's great you are figuring it out!
You need to change the execute copy script to use 'textarea' instead of 'input' see attachment
Joe -
Categories
- 35.8K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 321 CenarioVR®
- 188 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 5 The Training Arcade®
- 5 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products