Hi
I'm having a bit of trouble getting the spell checker to update my checked controls with their proper spelling. I've noticed that the correct values don't display until I click on the controls themselves, and have read that I need to use updateDisplayValue() to make the control display the corrected spelling, but when I call this function, it seems to do nothing. I have also hooked up a handler to the CheckFinished event, and am automatically submitting the page (ie. doing a postback), and the incorrect spelling is still there. How would I go about fixing this?
I'm having a bit of trouble getting the spell checker to update my checked controls with their proper spelling. I've noticed that the correct values don't display until I click on the controls themselves, and have read that I need to use updateDisplayValue() to make the control display the corrected spelling, but when I call this function, it seems to do nothing. I have also hooked up a handler to the CheckFinished event, and am automatically submitting the page (ie. doing a postback), and the incorrect spelling is still there. How would I go about fixing this?
| <telerik:RadSpell ID="rsSpell" runat="server" Skin="Office2007" ButtonType="None" /> |
| spellCheck(); |
| $find("<%= rsSpell.ClientID %>").add_clientCheckFinished(SendSMSAfterSpell); |
| //here we create a simple text source for the RadEditor control - used to get/set the text |
| //to spellcheck |
| function EditorTextSource(editor) { |
| this._editor = editor; |
| } |
| EditorTextSource.prototype = |
| { |
| get_text: function() { |
| var text = this._editor.get_html(true); |
| return text; |
| }, |
| set_text: function(text) { |
| this._editor.set_html(text); |
| } |
| } |
| //this function creates a composite text source for the RadSpell control (using a RadEditor |
| //and a TextBox). The content of all controls is checked at the same time. |
| function spellCheck() { |
| var elements = [new Telerik.Web.UI.Spell.HtmlElementTextSource($get("<%= txtSCSDetails.ClientID %>")), |
| new Telerik.Web.UI.Spell.HtmlElementTextSource($get("<%= txtMessage.ClientID %>"))]; |
| var spellSource = new Telerik.Web.UI.Spell.MultipleHtmlElementsSource(elements); |
| var spell = $find("<%= rsSpell.ClientID %>"); |
| spell.spellCheck(spellSource); |
| } |
| function SendSMSAfterSpell(sender, args) { |
| args.suppressCompleteMessage = true; |
| var text; |
| text = $find("<%= txtMessage.ClientID %>"); |
| text.updateDisplayValue(); |
| text = $find("<%= txtSCSDetails.ClientID %>"); |
| text.updateDisplayValue(); |
| SendMessage(); // this does the postback, which still sees the controls as having incorrect spelling |
| } |