...

View Full Version : copyToClipBoard()



ruth
07-02-2005, 12:39 AM
Hello,

I'm not sure this is the kind of forum I should be using since I saw the programming part. Let me say that I don't know anything about javascript and I was only looking for a help forum for a script.

I apologize for a long post, but I don't know what to put in and what not to make sure I explain clearly what I am trying to find.

Background:

When you left click the mouse and drag and highlight text then right click you get a little menu with option, two of which are copy and paste.

Within my webpage navigation menu there is a 'special' right click context menu that allows me to configure it, i.e bgcolor, separators, images. It contains things such as Home page link, print, back, forward, view source, and the last item is disable this menu, which now activates just the usual right click menu when you right click on the web page.

A person can also add items to the dynamic menu, like an option for Open and Open in a New Window. It's not hard to put an item in, but you must of course have whatever function will let the item you put in work and you have to call the function. For example, Open in a New Window can be added and then the function called that 'reads the link when you right click on it and adds the necessary target=_new option so when you click the Open in New Window on that context menu it would open the link in a new window.

I looked at that item and figured out how that was added to the dynamic context menu and how they called the function for it, so I figured out how to add what I want, and how to call the function but I don't know what the function is. I've searched and found a lot of copy functions, copyToClipBoard, copy to text area, but all the ones I've found seem to have specified text to copy, either in spans with IDs set, or in the function it seems. What I want is the functions necessary for copying highlighted text and pasting that copied text, the ones that are on the normal right click menu when you've highlighted text. Or if that isn't possible maybe a copyToClipboard function.

I found one that is supposed to work in Moz/Nets/IE but though I tried it, I just get a message 'meintext' is not defined which I have no idea what that is. I think from reading it uses something to do with java and signatures and such for other than IE. The function is at http://www.krikkit.net/howto_javascript_copy_clipboard.html
However, I don't necessarily need that function, I'd just like a normal copy function and paste function if that is possible, or to find out it's not possible, so I can stop searching and registering in forums way over my head :)

Sorry for the really long post

Ruth

Willy Duitt
07-02-2005, 01:23 AM
Have you tried the Search (http://www.codingforums.com/search.php?) feature...
This question has been asked and answered numerous times...
Please bear in mind... SP2 and/OR Mozilla seriously affects your success...

.....Willy

ruth
07-02-2005, 05:05 AM
Have you tried the Search (http://www.codingforums.com/search.php?) feature...
This question has been asked and answered numerous times...
Please bear in mind... SP2 and/OR Mozilla seriously affects your success...

.....Willy

Yes, but all the ones I found using copy to clipboard gave me posts on copying textarea, or copying from one text area to another, or copying a file to the clipboard. I didn't find any that just had to do with copying highlighted text to clipboard. I've been searching for a couple of days now, I guess I just have to think of different terms to search :)

Ruth



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum