Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 13th, 2006, 11:05 AM
Gernot Frisch
Guest
 
Posts: n/a
Default Copy to clipboard

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
Default 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
Default 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
Default 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
Default 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
Default 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/
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles