Original Post
I have this javascript function which i have written to take a highlight piece of text in the control passed in and wrap it in bold tags, this works in Firefox, but not in IE. Does anyone have any idea how i get this to work in IE? Currently all that happens is that it appears to double up the string: In IE: original is: 123 and after running that function i get: 123123123 rather than 123 Any ideas? Dave
function MakeBold( txtarea )
{
var before = (txtarea.value).substring(0,txtarea.selectionStart);
var selection = (txtarea.value).substring(txtarea.selectionStart, txtarea.selectionEnd);
var after = (txtarea.value).substring(txtarea.selectionEnd,txtarea.value.length);
txtarea.value = before+""+selection+""+after;
}