The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.

Create a free forum like this one.

Code to copy text to clip board

Go down

Code to copy text to clip board

Post by Sir. Mayo on July 25th 2013, 9:23 pm


I'm looking for a code that copies text to the users clip board when the button is pressed.

SO i want a button that when pressed its Copies a Email address to the users clip board. Any on know how to do this???
Sir. Mayo

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

Back to top Go down

Re: Code to copy text to clip board

Post by Mr.EasyBB on July 26th 2013, 5:00 am

Sir Mayo, with Google Chrome and Firefox this is not allowed, only with Internet Explorer is this allowed with code.

A code would look like:

  function select_all(obj) {
        var text_val=eval(obj);
        if (!document.all) return; // IE only
        r = text_val.createTextRange();

Then on the button you do

<input value="" onclick="select_all(this)" name="url" type="text" />


Posts : 71
Reputation : 9

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum