Callback after Spell Checking 

After you have spell Checking using the SpellCheck window, you may want to perform an operation in JavaScript such as:

  • Submitting a form
  • Alerting the user with a message
  • Any other script you may wish to call

This is very easy; simply set the JavaScript SpellCheck callBack function.

var oSpell = new JavaScriptSpellCheck()
oSpell.callBack=anyFunctionName

Example 1:  Alerting the user

<textarea id="textarea1" name="textarea1">Sentance to Spell Check</textarea>
<input type="button" value="Submit" onClick="spellCheck()">

<script src="/JavascriptSpellCheck/Include.js" type="text/javascript"></script>

<script type="text/javascript" >


function spellCheck()
{
    var oSpell = new JavaScriptSpellCheck();
    oSpell.callBack=myCallBack
    oSpell.spellCheckWindow('textarea1')
}

function myCallBack()
{
    alert('Spell Check is Complete');
}

</script>

 

Example 2:  Submitting a Form

<form id="form1" name="form1">
<textarea id="textarea1" name="textarea1">Sentance to Spell Check</textarea>
<input type="button" value="Submit" onClick="spellCheck()">
</form>

<script src="/JavascriptSpellCheck/Include.js" type="text/javascript" ></script>

<script type="text/javacsript" > function spellCheck()
{
    var oSpell = new JavaScriptSpellCheck();
    oSpell.hideSummary=true;
    oSpell.callBack=function()
    {
        alert('Submitting Form')
        document.form1.submit()
    }

    oSpell.spellCheckWindow('textarea1')
}

</script>