SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Accredited Master scotty2260's Avatar
    Join Date
    Apr 2004
    Location
    California
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    click copes to clipboard

    I have seen where you can put text in a text field and then click the form button to capy it all.

    I want to have text (outside of a text field) to do the same. is that possible?

    Thank you
    Scott

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think that is possible even in a text field (I've never seen it done anywhere). You can spoof a clipboard in Javascript, but I don't think JS can interact with the OS clipboard.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,784
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The only browser that can interface with the clipboard is Internet Explorer either via VBScript or JScript. That is the only browser that knows for sure which operating system it is running on since it only runs on Windows (there used to be a Mac version but that died in 2003).

    The browsers that run Javascript can run on a number of different operating systems not all of which have a clipboard and Javascript provides no access to anything outside of the browser (except cookies) and only limited read only access to some browser settings.
    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
  •