Version 3

    Adding spell checker


    If you want to use spell checker in your portlet you just have to add


    <input type="button" value="Check Spelling" onClick="openSpellChecker();"/>


    somewhere on the page and this will execute spell checker for all text inputs on the page (also those that are not inside your portlet).




    If you want to execute speller for only some inputs please look through this execution examples:

    function openSpellChecker() {
         // example 1. 
         // Pass in the text inputs or textarea inputs that you 
         // want to spell-check to the object's constructor,
         // then call the openChecker() method.
         var text1 = document.form1.text1;
         var textarea1 = document.form1.textarea1;
         var speller = new spellChecker( text1, textarea1 );
         // example 2.
         // Rather than passing in the form elements to the object's
         // constructor, populate the object's textInputs property,
         // then call the openChecker() method.
         var speller = new spellChecker();
         var spellerInputs = new Array();
         for( var i = 0 ; i < document.form1.elements.length; i++ ) {
              if( document.form1.elements+.type.match( /^text/ )) {
                   spellerInputs[spellerInputs.length] = document.form1.elements+;
         speller.textInputs = spellerInputs;
         // example 3.
         // use the spellCheckAll() method to check every text input
         // and textarea input in every form in the HTML document.
         // You can also use the checkTextBoxes() method or checkTextAreas()
         // method instead of spellCheckAll() to check only text inputs
         // or textarea inputs, respectively
         var speller = new spellChecker();