I'm using a client-side API to start the spell check process.
I'm using onchange client-side event to launch the SpellCheck dialog.
However, the SpellCheck dialog still appears & says "The spell check is complete!" even there are no misspelled words.
How can I suppress the SpellCheck dialog when there are no mispelled words ?
-JScript-
function MultipleTextSource(sources) {
this.sources = sources;
this.get_text = function () {
var texts = [];
for (var i = 0; i < this.sources.length; i++) {
texts[texts.length] = this.sources[i].get_text();
}
return texts.join("<controlSeparator><br/></controlSeparator>");
}
this.set_text = function (text) {
var texts = text.split("<controlSeparator><br/></controlSeparator>");
for (var i = 0; i < this.sources.length; i++) {
this.sources[i].set_text(texts[i]);
}
}
}
function spellCheck(obj, field) {
var sources =
[
new Telerik.Web.UI.Spell.HtmlElementTextSource($get(field))
];
var spell = GetRadSpell(obj);
spell.set_textSource(new MultipleTextSource(sources));
spell.startSpellCheck();
}
-ASPX-
<telerik:RadSpell ID="RadSpell1" runat="server" />
<asp:TextBox ID="TextBox1" runat="server" />
-Code Behind-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Attributes.Add("onchange", "spellCheck('" & RadSpell1.ClientID & "','" & TextBox1.ClientID & "')")
End Sub