spell check does not work from javascript

3 posts, 1 answers
  1. Joel R
    Joel R avatar
    25 posts
    Member since:
    Nov 2007

    Posted 19 Oct 2009 Link to this post

    I have tried the example for starting spell check from javascript but it is not working for me.  The spell check windows opens and then immediately closes.  If I set buttonType="PushButton" and then click on the spell check button the spell check works as desired.

    I used a good Telerik sample but cannot find the exact reference that I used but the link below is basically what I used

    Below is a non working sample.  I am using Telerik version 2009.2.826.35

    Any help is greatly appreciated.


    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="QuestionNote.aspx.vb" Inherits="QuestionNote" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head id="Head1" runat="server">  
        <title>Question Note</title> 
        <script type="text/javascript">  
            function spellCheck()  
                var spell = $find("<%= RadSpell1.ClientID %>");  
            function checkFinished (sender, args)  
                args.suppressCompleteMessage = true;  
        <form id="form1" runat="server">  
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
        <table width='100%' cellpadding='2'>  
                    <asp:TextBox ID="tbxNote" runat="server" Width="100%" Height="100" TextMode="MultiLine" Text='asdf' 
                <td align='center'>  
                    <input type="submit" name="Save" value="Save" class="ButtonNormal" onclick="return spellCheck()" /> 
                    <asp:Button ID="btnCancel" runat="server" CssClass="ButtonNormal" Text="Cancel" /> 
        <input id="control" type="hidden" name="control" runat="server">  
        <telerik:RadSpell ID="RadSpell1" runat="server" 
            ButtonType="None" ControlToCheck="tbxNote" OnClientCheckFinished="checkFinished" /> 










  2. Answer
    Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 20 Oct 2009 Link to this post

    Hello Joel R,

    Add the following line to your code and it will work as expected:

    function spellCheck()
        var spell = $find("<%= RadSpell1.ClientID %>");
        return false;

    The reason for the problem is that you are using a submit button to call a JavaScript function. When you click it, the OnClientClick eventhandler is executed, e.g. the RadSpell is shown, but immediately after that the postback, that this submit button invokes, takes place and the page is reloaded. To avoid that you should cancel the postback.

    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Joel R
    Joel R avatar
    25 posts
    Member since:
    Nov 2007

    Posted 21 Oct 2009 Link to this post

Back to Top