Re: PasteHTML doesnt work within a modal popup (example page attached)

  •  07-15-2010, 10:42 PM

    Re: PasteHTML doesnt work within a modal popup (example page attached)

    Reading another post I found that it looks like the text is being saved only onblur with the editor .. unless it's called, it wont save to a hidden field.  So with that said, I found a killfocus function that does the trick that forces the focus to be removed.  The new code looks like this.
     
    function insertMe(textToInsert) {
          
        //get editor
        var editor1 = document.getElementById('<%= editor.ClientID %>');          

        //paste replace text in editor
        editor1.PasteHTML(textToInsert);
     
       //kill the focus
        killFocus(editor1);
     
    }
     
     
    function killFocus(refElement)
    {
        var input  = refElement.ownerDocument.createElement("input");
        input.type = "text";
        refElement.parentNode.appendChild(input);
        input.focus();
        input.parentNode.removeChild(input);
    };
     
     
View Complete Thread