Testing The Water

The spellCheckWindowTest  function allows you to determine if a spellchecker window is needed before you start spell checking.

The function will tell you if there are any spelling mistakes in your fields, so you don't spellcheck unnecessarily.   It returns true or false, and its inputs are conveniently the same as for the spellCheckWindow function.

spellCheckWindowTest  ('field1'','field2'')   // returns true or false.

 

Example:

<textarea id="textarea1" name="textarea1">Sentence 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();
    if (oSpell.spellCheckWindowTest('textarea1'))
    {
        alert('All Spelling is OK')
    }
    else
    {
        oSpell.spellCheckWindow('textarea1')
    }
}
</script>