Forum Moderators: open
<html>
<head>
<script type="text/javascript">
function insertText() {
if (document.selection && document.selection.createRange) {
var str = document.selection.createRange().text;
}
eval("document.forms[0].body.focus()");
document.selection.createRange().text = str;
}
</script>
</head>
<body>
<p>Select this text and click this <a href="javascript:insertText()">link</a>.</p>
<form><textarea cols="50" rows=
"1" name="body"></textarea></form>
</body>
</html>
I wrote a really cool selected text to form script, complete with a custom context menu, for use in the forum listed in the site in my profile. It's a good example of how handy this feature can be.
I wish Opera and FireFox would support selected text to form.