Hi
I'm making a pigs ear of this. (inserting an image into RichTextBox)
I need to check to see if a selection point has been made:
If it has insert, else set the focus and createRange and insert...
function AddImage()
{
var rtb_id = document.<%=editor %>;
var item = document.Form1.ImageUrl;
if (item.value != "none")
{
rtb_id.focus();
//need to check to see if a selection has been made
if (sel == "")
{
var rtb_id = document.<%=editor %>;
rtb_id.focus()
sel = rtb_id.document.selection.createRange();
}
//sel = rtb_id.document.selection.createRange();
sel.pasteHTML('<img border=0 src=' + item.value + ' />');
item.value = "none";
}
else
{
rtb_id.focus();
sel = rtb_id.document.selection.createRange();
GoToFileManager();
}
}
Thanks
Robert