SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: copy paste

  1. #1
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question copy paste

    hi,

    there is a div i use as texteditor, there is a javascript that cleans the pasted code.
    so users can copy and paste lots of information and as the javascript runs on Ctrl+V it cleans the whole content of the div.
    can anyone help me how to clean only the latest pasted content?

    thanks in advance

    regards

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,788
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    You have no way of telling from JavaScript what was the currently pasted content UNLESS you keep a separate copy of the content each time it is updated and compare one to the other each time to see what has changed.
    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="^$">

  3. #3
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i see, i thought, hoped, there was an other way.

    thank you for your help

    regards


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
  •