SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast primozc's Avatar
    Join Date
    Nov 2008
    Location
    Slovenia, EU
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JS for copy text from textarea

    Hello,

    I would need js script that copy the content of specific textarea just with a clikc on link (or button). The problem is that generic copy function works only in IE. I googled a bit but found nothing. Can you advise me where to search?
    I don't know much about js ...

    Thank you!

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you want to copy it to the user's clipboard or somewhere else on the page?
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    SitePoint Enthusiast primozc's Avatar
    Join Date
    Nov 2008
    Location
    Slovenia, EU
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of course, I forgot: to the clipboard.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Only IE has direct access to the clipboard. To be able to copy to the clipboard from other browsers (assuming they are running on an operating system that has a clipboard) you would need to use an alternative language to perform the copy such as Flash.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    SitePoint Enthusiast primozc's Avatar
    Join Date
    Nov 2008
    Location
    Slovenia, EU
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I have this option on my website (in signature - ipsum-generator) but is seems that this flash file doesn't work anymore in the latest version of flash plug-in. It stopped working when I upgraded flash version 2 days ago.

    My flash ver. is now: 10.0 r12.
    Any other suggestions?

  7. #7
    SitePoint Enthusiast primozc's Avatar
    Join Date
    Nov 2008
    Location
    Slovenia, EU
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really no any other suggestion?

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Since that's the only way to do it from within the web page the only alternate suggestion would be to let your visitors do the copy for themselves.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •