Hey Guys, can you please use the provided javascript in the website? I often never insert my bold marks or quote marks before pasting or what have you, the following code will let you insert text at the current position of the cursor in a textbox, for atleast IE and if they don't use IE then it will act like normal if it can't use it.
<script language="javascript"> function InsertAtCaret(textarea, txt) { if (textarea.textRange) { textarea.textRange.text = txt; textarea.textRange.select(); } else textarea.value += txt; } function SaveCaret(textarea) { if( textarea.createTextRange ) textarea.textRange = document.selection.createRange(); } </script>
<form id="myform" name="myform" method="post" action=""> <textarea id="myfield" name="myfield" ONSELECT="SaveCaret(this);" ONCLICK="SaveCaret(this);" ONKEYUP="SaveCaret(this);"></textarea> <br> <input name="test" type="button" value="test" onClick="javascript: InsertAtCaret(document.myform.myfield, 'Insert This Text');"> </form>
7/20/2004 12:47:11 AM
for real
7/20/2004 9:59:54 PM
ahahahaha, that second suggestion is funny. I agree with the first though
7/20/2004 10:54:40 PM