By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,215 Members | 1,936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,215 IT Pros & Developers. It's quick & easy.

a small problems with Select and Auto Copy

P: n/a
Dear Experts,

I want to capture the text to the clipbroad when i use the mouse left
clicking on such text..
( i want to simplify the step of "Highlight Text" > "Mouse Right Click" >
"Copy")
Can i use javascript to do this?

I found some hints about this from internet:
==============================================
<!-- Begin
function copyit(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")
}
// End -->
</script>

</HEAD>
<BODY>

<form name="it">
<div align="center">
<input onclick="copyit('it.select1')" type="button" value="Press to Copy the
Text" name="cpy">
<p>
<textarea name="select1" rows="3" cols="25">
If this is highlighted, then it has been copied.
</textarea>
</div>
</form>
=====================================
But this text needs inside the text box..
How can i do this?
Thans so much~

Koman Ko
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Koman ( Hong Kong ) wrote:
Dear Experts,

I want to capture the text to the clipbroad when i use the mouse left
clicking on such text..

<snip>

This code will copy text to the clipboard, works on my IE6, Netscape
7.2, Firefox 1PR, MOZ 1.7.3.

"this script only works in mozilla if you sign the javascript or if you
change some settings in mozilla... see notes below..."

http://www.krikkit.net/howto_javascr...clipboard.html

If you have trouble selecting just the text you want, post the code
you're using.

Mike
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.