How to enable and disable spell check on demand

6 posts, 1 answers
  1. Waseem
    Waseem avatar
    6 posts
    Member since:
    Nov 2011

    Posted 05 Feb 2013 Link to this post

    Hi,
    I am using RadSpell checker in my applicatioin. In this particular scenario dictionary settings are comming from DB on per user basis. In order to create dictionary settings we have provided a screen where user can upload a custom dictionary, can select a specific custom dictionary etc. Once these settings are defined and saved, application get these setting from DB whenver and wherever required. Till this point everything is perfectly fine but now I have to give the option of Auto Spell Check without making use of RadSpell button. In this case user will define (will be enabled/disabled from setting page) if he/she want to do spell check or not rather having spell check enabled all the time. Could please anyone tell me how I can achieve my desired functionality also how I can do spell check on lost focus without making use of RadSpell button.
    Kind Regards,.
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 07 Feb 2013 Link to this post

    Hi,

    Here is an example how to fire the spellchecker on blur of a textbox:

    <script type="text/javascript">
        function spellCheck() {
            var radtextbox = $find("<%=rtbAccomplishment.ClientID%>");
            setTimeout(function () {
                if (radtextbox.get_value() != "") {
                    var spell = $find("<%= RadSpell1.ClientID %>");
                    spell.startSpellCheck();
                }
            }, 10);
              
            return false;
        }
    </script>
    <telerik:RadTextBox ID="rtbAccomplishment" runat="server" onblur="spellCheck();"  ></telerik:RadTextBox>
    <telerik:RadSpell   id="RadSpell1" runat="server" ButtonType="None"   ControlsToCheck="rtbAccomplishment"/>


    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Waseem
    Waseem avatar
    6 posts
    Member since:
    Nov 2011

    Posted 08 Feb 2013 Link to this post

    Thank you Rumen!
    I have already done that by defining TextBox 'OnBlur' function. Thanks for your answer.
    Now I have a different problem and hope you may provide some work around.

    As my RadSpell is completly client side and it fires RadSpell on lost focus on the basis of saved settings (if user has saved a specific dictionary and also if he/she wants to do the auto spell check). Also, User has the option to not to choose auto spell but do it on demand (by clicking the rad spell button). Both scenarios working fine but as I also have a FormIsDirty Java Script function which fires everytime user nevigate awawy without saving changes. So when I click on Spell Check button, FormIsDirty fires and nevigate away dialog pops up before the spell check dialog as changes has been made in text box. I looked into the Rad Spell Client Events but didn't find any, where I can stop firing the navigate away dialog. Could you please tell me if there is any work around or dont you think Telerik should provide some more client side events for Rad Spell (e.g may be something like OnClientClick).
    Your help will really be appriciated.
    Kind Regards.
  5. Answer
    Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 08 Feb 2013 Link to this post

    Hello,

    This KB article could be helpful for this scenario: Enforce Spellchecking On Submit.

    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Jhonny
    Jhonny avatar
    5 posts
    Member since:
    Nov 2013

    Posted 02 Oct 2015 in reply to Rumen Link to this post

    Hi, Rumen.

    Is posible to call to method that verify all the text to check, without spell.startSpellCheck()....similar to 

     

    //New - throw event
                 this.raiseEvent("spellCheckStart");

                 //No mistakes found
                 if (spellCheckResult.badWords.length == 0) {
                     this.finishSpellCheck();
                 }​

  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 06 Oct 2015 Link to this post

    Hello Jhonny,

    RadSpell does not offer such a facility. The logic that handles checking words (sending them to the server and getting suggestions back) is actually in its dialog, not on the main page.

    Regards,

    Marin Bratanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017