Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: how to copy all

  1. #1
    New Coder
    Join Date
    Oct 2004
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to copy all

    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
    Last edited by sallam; 12-08-2004 at 10:06 AM.

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    *keep it simple (TM)

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts

    Cool

    he he
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #4
    New Coder
    Join Date
    Oct 2004
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jbot
    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.

  • #5
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sallam
    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
    *keep it simple (TM)

  • #6
    New Coder
    Join Date
    Dec 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this:

    Code:
    <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>

  • #7
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    gee thanx, give him code to read our clipboards why dontcha!

    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
    *keep it simple (TM)

  • #8
    New Coder
    Join Date
    Dec 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    LOL .. that code and read other users clipboards, really?

    just helpin u know ...

  • #9
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by aifilaw
    read other users clipboards, really?
    yes ...
    *keep it simple (TM)

  • #10
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by aifilaw
    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.
    *keep it simple (TM)

  • #11
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Quote Originally Posted by jbot
    gee thanx, give him code to read our clipboards why dontcha!

    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
    Well now everyone knows what you could do.

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #12
    New Coder
    Join Date
    Dec 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #13
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    LMAO - I think you missed the point. Use it's ethical functionality. If at all. While it works.

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #14
    New Coder
    Join Date
    Dec 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes yes i see ... oops .. a lil slow. lol ... but what kind of infomation do ppl keep on their clipboards?

  • #15
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by aifilaw
    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!!
    *keep it simple (TM)


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •