<html><head><script language="JavaScript">
function ClipBoard()
{
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("Copy");
}
</script>
</head>
<body>
<span id="copytext" style="height:150;width:162;background-color:pink">
This text will be copied onto the clipboard when you click the button below. Try it!
</span>
<textarea id="holdtext" style="display:none;">
</textarea>
<button onclick="ClipBoard();">Copy to Clipboard</button>
</body>
</html>
The above code will copy the value of a span to clipboard .
But as you have mentioned .You have to copy the text of all the controls, you can iterate through all the input controls , find the value / text of each control , store it in some dictionary format , like <controlid,value> . Then on focus of element you can find the value of a specific control from the dictionary , set the text as clipboard text , and when user will press paste , the previous data will be pasted in the input field
Hope that helps.
[ Happy Coding ]