PrateekSaxena Posted December 28, 2006 Share Posted December 28, 2006 Hello,I want to access the clipboard of the computer. Like for example I have two testboxes on my HTML page, that are named "t1" and "t2" - <input type="text" value="T1" name="t1" /><input type="text" value="T2" name="t2" /> Now what I want is that when someone clicks on a button then the stuf in the clipboard should be coopied in both the textboxes. But not that, let us say that the clipboard has the string "w3c Schools". Now before the stuff is actually copied I want it to be taken by the JavaScript and broken into two that is "w3c" and "school" and then be copied in t1 and t2. I want to be able to let the JS go though the string before it actually gets copied.How can I do that?? Please help!I mean is it even pobbsile to do that? Link to comment Share on other sites More sharing options...
jesh Posted December 28, 2006 Share Posted December 28, 2006 You can look into using execCommand() to do this fairly easily in IE, but there are some issues, it appears, with doing this in Firefox.This Google search may help. Link to comment Share on other sites More sharing options...
Webworldx Posted December 28, 2006 Share Posted December 28, 2006 Why not copy it into box 1 then fire an onChange() that splits the string into the second box?I showed a proof of concept of this months ago when someone asked for an emulation of the "licence key" boxes in software installations where you can paste in your key over multiple boxes. Link to comment Share on other sites More sharing options...
Webworldx Posted December 30, 2006 Share Posted December 30, 2006 As an update, I found this on my site: http://ifcode.com/home/index.php?option=co...4&Itemid=44 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now