Hi Morris,
That worked. However I am creating page using html only so cannot use panel
or as asp code. The page has several tables and I want to copy code from a
row in the table.
The Page below has 2 tables, each table has 2 rows. I want a link on row 1
"Copy code below" that when used would copy to clipboard. How can I do
that?
Thanks for your reply. Please try this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>Walkthrough: Test Code Copy</TITLE>
<link href="../html/style.css" rel="stylesheet" type="text/css" >
</HEAD>
<script type="text/javascript">
function Copy() {
//var data = document.getElementById('<%=Panel1.ClientID
%>').innerHTML;
var data = document.getElementById('entryscript').innerText;
window.clipboardData.setData('Text', data);
alert("done!");
}
</script>
<BODY>
<h3>Walkthrough: Test Code Copy</h3>
<p>Let's create the scripts first. Open Notepad and create scripts
following
code examples below. Remember to save them as .bas type files in the
Program Files\CALLMaster\Scripts folder.</p>
<table id="tableEntry" class="script" border="1" cellspacing="0"
style="width: 844px">
<tr>
<td><strong>CALLBasic Script - Entry.bas </strong></td>
<td><a href="javascript:Copy()">Copy to Clip Board</a></td>
</tr>
<tr>
<td id="entryscript" colspan="2">Program<br>
Print "CM Entry Script started
on "<br> PrintNL
$today<br><br>
' @SponsorNo set to 0<br> @SponsorNo = 0<br><br>
EndProgram<br><br></td>
</tr>
</table>
<table class="script" border="1" cellspacing="0" style="width: 844px">
<tr>
<td><strong>CALLBasic Script - Check-n-Set-SponsorNo.bas</strong></td>
<td><strong>Cope code below</strong></td>
</tr>
<tr>
<td colspan="2">Program<br> ' This script uses
the Return
command with a variable. When used with an Audiotex module whose
action is Audiotex, the caller will be forwarded to the Audiotex module
whose
number is equal to variable strRetVar.<br> Return
strRetVar<br>
<br>EndProgram<br><br></td>
</tr>
</table>
</BODY>
</HTML>
Regards,
Allen Chen
Microsoft Online Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).