SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    4
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Textbox with automatic selection of text in order to copy to clipboard.

    Hello,

    I need a small solution in order to select all text in a textbox when I click on it which I have predefined in the source. This text can have multiple lines and can be PHP, Jquery, HTML or whatever what kind of text.
    The idea behind is that I can click on it and with Ctrl-C I can move the selection to my clipboard in order to put in my IDE (editor).
    It should look something like this: http://jsfiddle.net/NNqyF/
    That demo is not able to give multiple lines and any kind of code or text.
    If anyone has got a solution it would be really appriciated.

    Thanks in advance for any help!

    grid

  2. #2
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    4
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    The final solution is what I found here:

    http://www.plus2net.com/javascript_t...ea-onclick.php

    Have a nice day,

    grid

  3. #3
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,229
    Mentioned
    265 Post(s)
    Tagged
    5 Thread(s)
    Thanks for posting back, @gridishere , but I'm afraid that link is incomplete and giving a 404 error.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •