/    Sign up×
Community /Pin to ProfileBookmark

Code for Copy and Paste please

Hi, I think this is probably easy, but I just don’t know it.

My user will press a button to submit a high score. The high score is on the screen in a textbox, and also held in a variable on that page. When the button is pressed a new form opens up for him to enter name, email and a few other details including the score. What is the js code that will copy the score from the first page and then paste it into the receiving textbox on the new page?

To see it in action, go to rolloworks.co.uk/patterncatch play.html, select the screen called Driving, and click on Solutions.

Thanks, Tim

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@donatelloAug 24.2009 — I have a code but it is annoying as MS Internet Exploerer just makes a popup that warns off the visitor and it does not copy to the clipboard in Firefox.

The best one I have seen is on AddThis: www.addthis.com

Go through their short get button screen and you will see what I mean. It works cross-browser and does not prompt an alert in IE!

You can see the script I use on my latest site under site reviews. I've used it in an iframe code generator. I was too lazy to spend an hour figuring out the script that AddThis used.

http://www.webdeveloper.com/forum/showthread.php?t=215507

I used a "Highlight and Select" script that I got off of either Dynamic Drive or DHTML Goodies... can't remember where I found it, but the header is intact so you can trace my steps.
Copy linkTweet thisAlerts:
@huyphamNov 08.2012 — hi

can you show me how to get a code at AddThis site ...I seem to be lost there.

Thanks a lot.
×

Success!

Help @Mr_T2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...