SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    0 Post(s)
    0 Thread(s)

    So I'm trying to write this crazy script...

    I have another question posted, but now I'm wondering if my design is flawed.. here's the situation:
    -Some software is watching the clipboard for info, and once it detects that a browser window of a certain name has pasted info into the clipboard, it will load a website showing search results of that info.

    -The info that's pasted needs to come from a form, where the first form field is already populated by some data passed to the form

    -The software above always loads the website into whatever window is in focus (no way to change this), and replacing the main window's contents with this new website is unacceptable.

    So I came up with this:

    1) display a form with the first form field already showing a value that's been passed to it
    2) the user fills out the rest of the form, then presses submit
    3) the script concatenates the form values into one string
    4) the script opens a child window, and then a function in the child window pastes that string into the clipboard.

    Basically the window pasting the info to the clipboard can't be the parent window, or the software will replace it's contents, it must be a child window..
    Any ideas of another way to handle all of this?
    Thanks so much

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Lancaster University, UK
    2 Post(s)
    0 Thread(s)
    Yes that is "a little" complicated.
    eerrrmmm, i think that it wouldn't work, HOWEVER, i think it could work quite easily with an iframe with the form in...

    Just to be nosey, what is this used for?
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Sydney, NSW, Australia
    25 Post(s)
    1 Thread(s)
    Only JScript (in Internet Explorer) has access to the clipboard.

    Javascript (used by all browsers except IE) don't even know if the operating system they are running on has a clipboard and can't access it even if it does.

    I assume that you are working on something for an intranet site where you know that IE is the only browser being used.

    You will also need to ensure that the browser on each computer is configured so that the popup blocker doesn't block the child window from opening.
    Stephen J Chapman, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Posting Permissions

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