Selected Cursor Position

  •  11-25-2009, 7:59 AM

    Selected Cursor Position

    When I am selecting text from cute editor I am selecting it with following code

    ar editor1 = document.getElementById('<%=Editor1.ClientID%>');

    var editdoc=editor1.GetDocument();

    var objselect=editdoc.selection;

    var range = objselect.createRange();

    if(range.htmlText!=null || range.htmlText!="")

    {

    document.getElementById("hdgetRejectText").value=range.htmlText;

    }
     
    at server side I am replacing this hidden field's valu with some other calculated value and I am saving new value in new hidden field. I want to replase the selected value with this newly calculated value. But during calculations page gets postback and I am loosing the selected text due to which range.pasteHTML(newHiddenfieldvalue) is not getting the position where to paste this newly calculated value. Please help to solve this problem
View Complete Thread