Connecting Tech Pros Worldwide Help | Site Map

Copy to clipboard

  #1  
Old March 13th, 2006, 11:05 AM
Gernot Frisch
Guest
 
Posts: n/a
How can I put text from a <textarea name="test"></textarea> into my
clipboard (Windows, Firefox+IE).

--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com


  #2  
Old March 13th, 2006, 01:05 PM
McKirahan
Guest
 
Posts: n/a

re: Copy to clipboard


"Gernot Frisch" <Me@Privacy.net> wrote in message
news:47l12vFfojo1U1@individual.net...[color=blue]
> How can I put text from a <textarea name="test"></textarea> into my
> clipboard (Windows, Firefox+IE).[/color]

Will this help -- for IE anyway?

<html>
<head>
<title>clipboard.htm</title>
<script type="text/javascript">
function copy(what) {
window.clipboardData.setData('Text',what.value);
}
function paste(what) {
what.value = window.clipboardData.getData('Text');
}
</script>
</head>
<body>
<form>
<textarea name="data" cols="50" rows="10"></textarea>
<br>
<input type="button" value="Copy" onclick="copy(this.form.data)">
<input type="button" value="Paste" onclick="paste(this.form.data)">
<input type="reset" value="Clear">
</form>
</body>
</html>


  #3  
Old March 13th, 2006, 01:25 PM
Gernot Frisch
Guest
 
Posts: n/a

re: Copy to clipboard


[color=blue]
> Will this help -- for IE anyway?
>
> <html>
> <head>
> <title>clipboard.htm</title>
> <script type="text/javascript">
> function copy(what) {
> window.clipboardData.setData('Text',what.value);
> }
> function paste(what) {
> what.value = window.clipboardData.getData('Text');
> }
> </script>
> </head>
> <body>
> <form>
> <textarea name="data" cols="50" rows="10"></textarea>
> <br>
> <input type="button" value="Copy" onclick="copy(this.form.data)">
> <input type="button" value="Paste" onclick="paste(this.form.data)">
> <input type="reset" value="Clear">
> </form>
> </body>
> </html>[/color]


"Clear" works ;)
No, I can't get clipboard to work on firefox (1.5.0) with that. Nor
did I see any solution in the internet that works :(
-Gernot


  #4  
Old March 13th, 2006, 02:55 PM
McKirahan
Guest
 
Posts: n/a

re: Copy to clipboard


"Gernot Frisch" <Me@Privacy.net> wrote in message
news:47l9ioFg5d2qU1@individual.net...

[snip]
[color=blue][color=green]
> > Will this help -- for IE anyway?[/color][/color]

[snip]
[color=blue]
> "Clear" works ;)
> No, I can't get clipboard to work on firefox (1.5.0) with that. Nor
> did I see any solution in the internet that works :([/color]

Did you miss the "for IE anyway?" part?


  #5  
Old March 13th, 2006, 04:35 PM
Gernot Frisch
Guest
 
Posts: n/a

re: Copy to clipboard



[color=blue]
> Did you miss the "for IE anyway?" part?
>[/color]

No. But I missed the "firefox" part ;)


  #6  
Old March 13th, 2006, 09:25 PM
Randy Webb
Guest
 
Posts: n/a

re: Copy to clipboard


Gernot Frisch said the following on 3/13/2006 11:24 AM:[color=blue][color=green]
>> Did you miss the "for IE anyway?" part?
>>[/color]
>
> No. But I missed the "firefox" part ;)
>
>[/color]

That is because Firefox does not give you access to the clipboard - if
the UA/OS even have one.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementation of "Copy to Clipboard" Curious answers 0 August 13th, 2007 07:45 PM
Can't Copy to Clipboard SAL answers 3 February 8th, 2006 03:05 PM
JavaScript : Select and Copy to clipboard Shimon Sim answers 2 November 19th, 2005 03:17 PM
Copy to ClipBoard problem Jean-Luc ERNST answers 3 July 23rd, 2005 08:21 PM
copy to clipboard Manuel answers 1 July 23rd, 2005 08:07 PM