1

My goal is to capture the pasted data into a TextArea attached to an HTMLEditorExtendor and remove all the html, then put that modified data into the control. Is this possible? I've tried to grab the OnPaste event but it doesn't seem to fire. This is what I have so far:

 <script type="text/javascript">
    $(document).ready(function () {
        var txt = $('#<%=txtText.ClientID%>');
        txt.on('paste', function () {
            var element = this;
            setTimeout(function () {
                alert("PASTE");
                text = $(element).val();
            },100)
        });
    });
</script>
<hr />
<asp:TextBox runat="server" ID="txtText" TextMode="MultiLine" Height="200px" Width="500px" />
<ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1"
    TargetControlID="txtText" DisplaySourceTab="true"
    runat="server">

I cannot get the PASTE function to fire. Hopefully I am heading in the right direction here.

DevSa
  • 178
  • 3
  • 16
Jon Glazer
  • 783
  • 1
  • 10
  • 25

0 Answers0