New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Use SpellCheckService to derermine if there are mistakes in the RadEditor content


See how to determine on submit if there are spelling mistakes in the RadEditor content and if any to automatically start the SpellChecker.


In some scenarios it is useful to ensure that the content to be submitted is spell checked and does not contain mistakes. The code bellow shows how to achieve this functionality.

<script type="text/javascript">      
function check()      
    var editor = $find("RadEditor1");      
        var spell = editor.get_ajaxSpellCheck();    
        //this code is called when the spellchecking is finished   
            function(sender, args)    
                //Now you may submit the content.   
        } );   
    var spellCheckService = $create(Telerik.Web.UI.SpellCheckService, editor.get_spellCheckJSON(), null, null);      
    spellCheckService.add_complete(function(sender, args)      
            //Check if there are mistakes in the content   
            if (args && args.badWords && args.badWords.length>0)      
                alert("There are spell mistakes in the content.");   
                alert ("There are no spell mistakes. The content can be submitted.");      
<telerik:RadEditor ID="RadEditor1" runat="server" Skin="Default" ToolProviderID="">   
<asp:Button id="btn1" runat="server" OnClientClick="check(); return false;" Text="Submit"/>  
In this article