CRO8 Posted August 18, 2004 Posted August 18, 2004 Hey all I have a question about a copy button. I heard javascript can do this. But let me explain my situation and then see what my options are. I have a 4 column table with all the info. this table will be created using php pulling data from a mysql database. Each coupon offer will have a code associated with it. I want to be able to have a button or even better have the code be a hyperlink where it can be clicked, and have the code copied to the pasteboard, so someone can paste it on another site. Can someone point me in a direction? Thanks! Quote
ThumpAZ Posted August 18, 2004 Posted August 18, 2004 I have been scouring around a bit and can only come up with the JS script you mentioned. From what I am able to gather, without client side scripting, and that includes JS, you may not be able to do what you ask. I am still looking, though... I am just not as familiar with php as I would like to be yet. Quote
CRO8 Posted August 18, 2004 Author Posted August 18, 2004 ok thanks. I guess all I would need is JSscript on client side but figured its good for you to know what else Im using on the site (php mysql dbase) Thanks! Quote
CRO8 Posted August 19, 2004 Author Posted August 19, 2004 I found this script on hotscripts and it works fine when I place it by itself in a page. But what I want to do is use the cpanel > mysql and place it within the code column in my table- but not working. Check out my code. ><script LANGUAGE="JavaScript"> function ClipBoard() { holdtext.innerText = copytext.innerText; Copied = holdtext.createTextRange(); Copied.execCommand("Copy"); } </SCRIPT> <SPAN ID="copytext"> sgeueie8 </SPAN> <br> <TEXTAREA ID="holdtext" STYLE="display:none;"> </TEXTAREA> <a href="#" onClick="ClipBoard();">Copy</a> Quote
CRO8 Posted August 20, 2004 Author Posted August 20, 2004 just had a thought. problem could be: 1) I put code within a table 2) I have multiple functions on same page. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.