469,336 Members | 5,570 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

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
Mar 13 '06 #1
5 10958
"Gernot Frisch" <Me@Privacy.net> wrote in message
news:47************@individual.net...
How can I put text from a <textarea name="test"></textarea> into my
clipboard (Windows, Firefox+IE).


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>
Mar 13 '06 #2
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>

"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
Mar 13 '06 #3
"Gernot Frisch" <Me@Privacy.net> wrote in message
news:47************@individual.net...

[snip]
Will this help -- for IE anyway?

[snip]
"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 :(


Did you miss the "for IE anyway?" part?
Mar 13 '06 #4

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


No. But I missed the "firefox" part ;)
Mar 13 '06 #5
Gernot Frisch said the following on 3/13/2006 11:24 AM:
Did you miss the "for IE anyway?" part?


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


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/
Mar 13 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Tor Inge Rislaa | last post: by
2 posts views Thread by Keith | last post: by
7 posts views Thread by lgbjr | last post: by
3 posts views Thread by SAL | last post: by
8 posts views Thread by serge calderara | last post: by
9 posts views Thread by Alan T | last post: by
17 posts views Thread by Steve | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.