Spell check before an email gets sent out

2 posts, 0 answers
  1. Martin Cheverall
    Martin Cheverall avatar
    1 posts
    Member since:
    Apr 2010

    Posted 10 Nov 2010 Link to this post

    We have a need to fire a spell check before an email gets sent out. The idea being, user clicks “Send” and once the spellcheck is complete, it would send without further interaction. This works with the following script very well. The only issue we have is that is distinguishing between whether the user clicked on “Cancel” on the spellchecker in RadEditor or the spell check completed. When the user clicks Cancel, we don’t want to send the email.

     

    Is there any way to know what condition fired the function attached to add_spellCheckEnd ? Or an alternative method?

     

        <script type="text/javascript">

                      

            function SpellCheckAndSubmit() {

                var editor = $find("<%=textEdit.RadEditorClientID%>");

                var sendButton = document.getElementById("<%=btnSendEmail.ClientID%>");

                editor.fire("AjaxSpellCheck");

     

                setTimeout(function() {

                    var spell = editor.get_ajaxSpellCheck();

                    spell.add_spellCheckEnd(function(sender, args) {

                    //if Cancelled Button Hit

                    //Do nothing

                    //else

                    //Do Event  

                        sendButton.click();

                    });

                }, 100);

                return false;

            }

        </script>

    Any help you can provide would be appreciated.

    Thanks
    Martin Cheverall

  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 11 Nov 2010 Link to this post

    Hi Martin,

    The RadEditor's inline spellchecker does not offer functionality to determine if the SpellCheckEnd client-side event is fired because of the spellcheck is complete or because the user has canceled it.

    To achieve the required functionality, I would suggest you to implement the RadSpell control as a custom tool to RadEditor and use its OnClientCheckFinished and OnClientCheckCancelled client-side events. You can find an example of how to implement RadSpell as a dialog to RadEditor in the following KB article:
    Using RadSpell "Prometheus" dialog with RadEditor "Prometheus" as a custom tool

    I hope this helps.

    All the best,
    Dobromir
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top