473,480 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 11150
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4302
by: tabonni | last post by:
Hello All I am creating an ASP page. There are a list of filename and checkbox next to it. When user checked all the documents they want and click ADD TO CLIPBOARD button. All filepaths will be...
3
43342
by: Tor Inge Rislaa | last post by:
Copy, Cut and Paste How to code the Copy, Cut and Paste functionality in VB.NET. In VB 6.0 I used the following code: 'For Copy Clipboard.Clear Clipboard.SetText...
2
3241
by: Shayne H | last post by:
I am trying to write a method to copy some text to the clipboard, and leave a copy of it there after the application has exited. Sub CopyToClipboard(ByVal value As Object) Dim data As New...
5
20987
by: DraguVaso | last post by:
Hi, I'm looking for a way to Copy and Paste Files to the clipboard. I found a lot of articles to copy pieces of text and bitmaps etc, but nog whole files. Whay I need is like you have in...
2
2660
by: Keith | last post by:
I'm trying to come up with a way to create a contextmenu that will do all the "standard" functions (cut, copy, paste, undo, etc). There seems to be a lot of information out there - but nothing...
7
11593
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
3
3701
by: SAL | last post by:
I have the following VB.net Class/Function that I call from an ASP.net page: Public Class MyTestClass Public Function embedHyperlink(ByVal fileID As Integer, ByVal fileName As String) As String...
8
2593
by: serge calderara | last post by:
Dear all, I have an treeview control with different node object, I would like to implement the Copy/Paste function of an object . For that I am using the folowing function to copy teh object to...
9
4794
by: Alan T | last post by:
Any source code example I can use to save the clipboard content to an object, then I will do a copy and paste, finally put back the 'saved' clipboard content back to clipboard ?
17
5071
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
0
6905
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6736
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.