Paste from clipboard not working
This HTML in AIR does not work correctly ... an
yone know why?
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TEST</title>
<script language="JavaScript" type="text/javascript">
function fixFMT(event) {
var cs = event.clipboardData.getData("text/plain");
if(!cs) return;
// processing for cs not shown
// now want to insert cs into the textarea in place of the selection.
var sel = window.getSelection();
var rng = sel.getRangeAt(0);
var insertion = document.createElement("b");
insertion.innerHTML = cs;
rng.insertNode(insertion);
sel.removeAllRanges();
event.preventDefault();
}
</script>
</head>
<body>
<form>
<table>
<tr><th>Paste text into the text area - then click outside and see it disappear.</th></tr>
<tr><td>
<textarea id="t1" name="t1" rows="4" cols="40" onpaste="fixFMT(event);" ></textarea>
</td>
</tr>
</table>
</form>
</body>
</html>