Link to home
Start Free TrialLog in
Avatar of Simon336697
Simon336697Flag for Australia

asked on

PHP

Hi Guys
Hope you can help.

What Id like to do is the following:

------------------------------------------------------------------------------- Web Page

===================================== Code Snippet1
Code in here.....
Code in here.....
Code in here.....
Code in here.....
-------------------------------------------------------- End of code
<Copy Code Button>
===================================== Code Snippet2
Code in here.....
Code in here.....
Code in here.....
Code in here.....
-------------------------------------------------------- End of code
<Copy Code Button>
===================================== Code Snippet3
Code in here.....
Code in here.....
Code in here.....
Code in here.....
-------------------------------------------------------- End of code
<Copy Code Button>


=============================================== End of web page.

All Im trying to do, is to:

Create a CopyCode Button that:

1) Selects automatically all the code in the text box, to the clipboard
2) Able to have as many CopyCode Buttons on the page as you want, which reference whatever text box the Code is in.

As Im using PHP/HTML, this would be the preferred scripting method.

Thanks guys in advance.
ASKER CERTIFIED SOLUTION
Avatar of thomaswright
thomaswright

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Simon336697

ASKER

Hi thomaswright!
Mate you are dead right.
Ill post this again in the javascript section.
Avatar of soitron
soitron

Hi Simon,

I use this feature of JAVASCRIPT many years.
You can search the Internet and find the solution, i.e. http://www.htmlgoodies.com/beyond/javascript/article.php/3458851

It may helps :-)

Frank
In firefox 2.0, access to the register is blocked.