sallam 12-08-2004, 10:04 AM Hi
I have this in a virtual keyboard script:
onclick=javascript:this.form.txt.focus();this.form.txt.select(); type=button value=" Select All"
I would like to ask: is it possible to add something to the above code, so that the button selects and copy all, in one step?
or if thats not possible, what code do I add to make another button for copy all, for users to click, after they click the 'select all' button?
Many thanks in advance :)
there is no copy command in JS, save in JScript. but even if there was a cross-browser solution, I wouldn't show you it. you could be up to no good ;)
sallam 12-08-2004, 12:03 PM there is no copy command in JS, save in JScript. but even if there was a cross-browser solution, I wouldn't show you it. you could be up to no good ;)
lol, what a freaky answer,
I better get out of here, before you reach for your gun.
jk.
ps. but thanks.
lol, what a freaky answer, I better get out of here, before you reach for your gun.
not freaky at all. why would i show how to do something which could potentially be used to hack my computer. i could visit your site and end up with information from my PC posted to your webserver, without me even knowing about it. ... and you think i'd honestly help you with that. it would be like me giving you the bullets to put into the gun you propose to shoot me with - suicidally daft!
have a nice day :D
aifilaw 12-08-2004, 04:44 PM Try this:
<html>
<head>
<title>Copy select</title>
<script>
function copyText() {
if (!document.all) return; // IE only
theForm = document.myForm;
r=theForm.copyArea.createTextRange();
r.select();
r.execCommand('copy');
}
</script>
</head>
<body>
<form name=myForm>
<input name="copyArea" value="Copy this Text">
<input type=button value="Copy" onclick=copyText()>
</form>
</body>
</html>
gee thanx, give him code to read our clipboards why dontcha! :rolleyes:
oh well, at least it won't effect me: i don't use IE, so there's no danger that it will work for me or 10% of the browser market :p
aifilaw 12-08-2004, 05:10 PM LOL .. that code and read other users clipboards, really?
just helpin u know ... :(
read other users clipboards, really?
yes ... :mad:
just helpin u know ... :(
don't help for the sake of it or just to get your post-count up. post judiciously. you might wanna tell the world you know the answer, but sometimes it's best to let it go. the M$ feature you mentioned is essentially an exploit, that's why I never answered. furthermore, it's IE only but not XP/SP2 compatible, so you've only given him a half-baked answer to boot.
Basscyst 12-08-2004, 05:26 PM gee thanx, give him code to read our clipboards why dontcha! :rolleyes:
oh well, at least it won't effect me: i don't use IE, so there's no danger that it will work for me or 10% of the browser market :p
Well now everyone knows what you could do. :p
Basscyst
aifilaw 12-08-2004, 05:34 PM do i get anything for have more posts behind changing the title?? lol
i didnt know the code can do so much ... can u show me hoooow?
Basscyst 12-08-2004, 05:41 PM LMAO - I think you missed the point. Use it's ethical functionality. If at all. While it works.
Basscyst
aifilaw 12-08-2004, 05:54 PM yes yes i see ... oops .. a lil slow. lol ... but what kind of infomation do ppl keep on their clipboards? ;)
what kind of infomation do ppl keep on their clipboards?
imagine you've just been to an e-commerce site and pasted your credit card number from the clipboard (you copied it from one field to another to save you typing it all out again). then you visit some other site and spyware pops up an advert which AdBlock or your firewall fails to block. this advert then checks the clipboard for anything resembling a CC no. and posts anything it finds to a remote server or to the spyware which then posts to the remote server.
do you understand now!! :eek:
aifilaw 12-09-2004, 04:41 AM :eek: i better stop copying my CC from place to place then ... :D
|
|