Hi Tracey,
You can define your own text source object and call the onchange event handler when the text is sent back to the source. Of course, you should wrap the textbox, so that the source gets and sets the text. Here is an example with a multiline textbox:
<asp:TextBox ID="textBox1" onchange="OnTextAreaChange()" Runat="server" Rows="5" Columns="50" TextMode="MultiLine" cssClass="">Thisz is a server side TextBox with some delibirate mistakees.</asp:TextBox>
<radS:RadSpell ID="spell1" Runat="server" ControlToCheck="textBox1" ButtonLabel=">> Spellcheck with a Link Button" ButtonType="LinkButton" />
<script type="text/javascript">
function OnTextAreaChange()
{
alert("Text changed");
}
var textAreaSource =
{
textArea : document.getElementById("<%= textBox1.ClientID%>"),
getText : function()
{
return this.textArea.value;
},
setText: function(text)
{
this.textArea.value = text;
var self = this;
window.setTimeout(function(){self.textArea.onchange();}, 200);
}
};
var spellChecker = RadSpell.getSpellChecker("<%= spell1.ClientID%>");
spellChecker.setTextSource(textAreaSource);
</script>
Note the self.textArea.onchange() call in the setText method. It will fire your event handler.
Sincerely yours,
Hristo Deshev
the
telerik team