1

I make a small web application that retrieve data and my clients copy information in the web page and paste data in excel

the problem is that copied data contains "html" elements about style or i don't know what and if users make a basic copy/paste it block macro in the excel document

If they copy data and paste in a notepad, re-copy and paste it will work, because, it remove unwanted data

searching on the internet, I found that, but it does not do what I want,

the idea is that when an user copy data the javascript "clean" the copied text and then no more issue

Delete text from copied text

How do you handle oncut, oncopy, and onpaste in jQuery?

http://www.htmlgoodies.com/beyond/javascript/article.php/3458851/Click-Its-Copied.htm

Community
  • 1
  • 1
Guillaume B.
  • 133
  • 1
  • 7
  • 1
    Could we see a link to your web app? – Matt Ball Jul 28 '10 at 14:06
  • Ok a sample is visible here http://news.imfos.free.fr/sampleStyleJavascriptCopy/ this is an "internal" application so the posted html is a static version of the tool in the real application you can have between 0 and 50 answers but the visual is equivalent – Guillaume B. Jul 29 '10 at 14:19

1 Answers1

0

You could put the text into the inner text of a <textarea> tag. Then, no formatting information will follow text when it's copied.

<textarea rows="4" cols="40">
  Text to be copied.
</textarea>
Abboq
  • 1,101
  • 1
  • 10
  • 21
  • thanks for your suggestion but I create a table (that I hope is nice) and the first goal of the data application is to give information to users – Guillaume B. Jul 29 '10 at 14:20