/    Sign up×
Community /Pin to ProfileBookmark

Help with javasctipt Copy to clipboard

Hi There,

I am looking for a script that will work on IE8 that will allow me to select text and by using the context menu of IE to have it copy the data to the clipboard.

I have setup the context menu but having trouble with the script. It just dosent copy the data.

Please help……

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@wbportFeb 12.2011 — You can go as far as doing [B]select()[/B] on the field but need to ask the user to copy it to the clipboard. I have to do that here (scroll to the bottom), but wish I could go further.
Copy linkTweet thisAlerts:
@JMRKERFeb 12.2011 — This is not exactly what you want, but it's a possible start...

In the body, define something like ...
<i>
</i>&lt;textarea id="myTextarea" name="myTextarea"&gt;&lt;/textarea&gt;

&lt;button onClick="this.form.myTextarea.focus();this.form.myTextarea.select();"&gt;
Highlight for Copy&lt;/button&gt;
Copy linkTweet thisAlerts:
@siselvisauthorFeb 12.2011 — Thanks for your help guys but I dont think this is what I need. Let me explain again.

I have some text in internet explorer which is a telephone number. I select it with my mouse and it highlights it and with my right click mouse I have the normal options copy, paste etc BUT I have created a custom option in the menu which starts up Microsoft word (the script is java script). I have this all working however I want it to also copy the selected text to the clipboard as well as open word so I can then paste what I highlighted where I want in the document. So what I am looking for is for some extra code which wil copy the selected text to the windows clipboard.

Does this explain it better?
×

Success!

Help @siselvis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...