Copy To Pasteboard

Hey all<br /><br />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 <a href="http://www.hotfrogdesign.com/table.htm" target="_blank">4 column table</a> with all the info. this table will be created using php pulling data from a mysql database.<br /><br />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.<br /><br />Can someone point me in a direction?<br /><br />Thanks!<!--content-->
I have been scouring around a bit and can only come up with the JS script you mentioned.<br />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.<br /><br />I am still looking, though... I am just not as familiar with php as I would like to be yet.<!--content-->
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)<br /><br />Thanks!<!--content-->
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 <b>the code column</b> in my table- but not working. Check out my code. <br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><script LANGUAGE="JavaScript"><br /> <br />function ClipBoard() <br />{<br />holdtext.innerText = copytext.innerText;<br />Copied = holdtext.createTextRange();<br />Copied.execCommand("Copy");<br />}<br /></SCRIPT> <br /><br /><br /> <br /><SPAN ID="copytext"><br />sgeueie8<br /></SPAN> <br><br /><br /><TEXTAREA ID="holdtext" STYLE="display:none;"><br /></TEXTAREA><br /><a href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"#" onClick="ClipBoard();">Copy</a><!--c2--></div><!--ec2--><!--content-->
just had a thought. problem could be:<br /><br />1) I put code within a table<br />2) I have multiple functions on same page.<!--content-->
 
Back
Top