Results 1 to 3 of 3

Thread: clipboard script to copy the form contents

  1. #1
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default clipboard script to copy the form contents

    hi I am developing a small tool for my college project and i need help. I have designed a website for my college and it has a form with text boxes, option buttons and combo boxes. i need to write a script that copies every content of the form to clipboard without changing the format so i can paste the same contents in notepard or word.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I believe that's still IE only (though the execCommand method is supported by others, it's options don't include 'copy' in those others as far as I know), see:

    http://msdn.microsoft.com/en-us/libr...19(VS.85).aspx

    and:

    http://msdn.microsoft.com/en-us/libr...49(VS.85).aspx

    You may also need information on making a selection range:

    http://msdn.microsoft.com/en-us/libr...01(VS.85).aspx

    and:

    http://msdn.microsoft.com/en-us/libr...72(VS.85).aspx

    That should get you the info you need for copying. However, preserving format, well that cannot even be done in many cases when using the mouse and the browser menu to do the copying to the clipboard part. Though often, and this depends to a degree upon what was selected, copying and pasting to Word from a web page will automatically preserve some of the elements of formatting. NotePad however is a plain text only editor and will never preserve formatting of any kind other than where lines wrap on CRLF character pairs.

    Note: All of the above links to the Microsoft Developer Network include links to other articles within the network that may also be of interest/required in this project.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for the info i will try these out... - Sadakathullah

Bookmarks

Posting Permissions

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