Click to See Complete Forum and Search --> : onselect="this.copy();"
NemoXP
02-20-2006, 02:24 AM
i have something like : <textarea rows="5" onclick="this.select();" cols="47">text text text</textarea>
and i want wen click-ing the baloon the text to automaticly select and copy itself to the clipboard... i`ve made it to select itself but i can`t make it copy
please help
pcthug
02-20-2006, 05:00 AM
Like This? http://www.geekpedia.com/tutorial126_Clipboard-cut-copy-and-paste-with-JavaScript.html
toicontien
02-20-2006, 10:06 AM
You can only copy to the clipboard in Internet Explorer (which is a browser no-no). No other browser, that I know of, allows JavaScript to copy anything to the clipboard, as it could pose a security threat (albeit small).
ray326
02-20-2006, 01:14 PM
security threat (albeit small).I'm not sure it's so small. If it allows copy it undoubtedly allows paste. Also, what would keep the script from using the DOM to scan a document for "interesting" items to copy/paste into DOM-generated hidden fields?
toicontien
02-20-2006, 01:20 PM
Very true. Hence the reason real browsers don't allow you to do that ;)
NemoXP
02-20-2006, 01:32 PM
what i say is like mIRC ... when you select the text ... it copy itself automaticly... but i want when i click a <textarea onclick="this.select"> text</textarea> to copy it automaticly
pcthug: something like that but i want to work in firefox too ... :) here is my problem... :)
toicontien
02-20-2006, 01:53 PM
NemoXP, I've already answered your question.
You can only copy to the clipboard in Internet Explorer (which is a browser no-no). No other browser, that I know of, allows JavaScript to copy anything to the clipboard, as it could pose a security threat (albeit small).
Internet Explorer is the ONLY browser you can do this with (thank God).
NemoXP
02-21-2006, 12:17 AM
oka... then.... i have dezactivated right click with the command <body oncontextmenu="return false"></body>
and in body i have a <?php include "home.php" ?>
how can i activate the right click only in home.php ? only at that part whwre the person must copy the text .. ?? can I do something like: <textarea oncontextmenu="return false"></textarea> ???
toicontien
02-21-2006, 09:15 AM
It's infinitely annoying to disable the right click. Lots of people do that to open links in new tabs and windows, not to mention access certain browser functions like Back and Forward. Just don't disable the right click. Don't impede on the normal functionality of the browser. I apologize if I sound blunt.
felgall
02-21-2006, 01:08 PM
A lot of modern browsers (eg. Opera) ignore any attemt to override the right mouse button and so ignore all references to oncontextmenu.
NemoXP
02-22-2006, 12:12 AM
oka.. then i will delet the "oncontextmeiu" :)
thanks for help :)
if you want tu se about what site i was talking visit www.nautilus.lx.ro
thanks again
one more question: how can i hide my source?
i heard about a java script witch dose this but i can`t find it
felgall
02-22-2006, 03:04 PM
There is onoly one way to hide your source that takes more than one second to bypass and that is to not put it on the web.
the tree
02-22-2006, 03:07 PM
i heard about a java script witch dose this but i can`t find itThat's because it doesn't exist.