Try to get this script to copy to the clipboard and not return to the page. When you click a link, it should be copied directly to the clip panel. At least that's my intention. Here are some facts behind this:
- This is for a companyβs intranet site that uses IE exclusively, so it should not be compatible with other browsers.
- Data inside is / will be return from db request
I understand that this is an old technology, but at the moment it should be so.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript"><!-- </script> </head> <body> <table> <tr> <td id="a1" name="t1">a</td> <td id="a2" name="t2">b</td> <td id="a3" name="t3">c</td> <td id="a4" name="t4">d</td> <td id="a5" name="t5">e</td> <td id="a6" name="t6">f</td> </tr> </table><br> <a href="#" onClick="CopyFields('a1', 'a2', 'a3', 'a4', 'a5', 'a6');">Copy values of text fields to clipboard</a> </body> </html>
source share