Instructions for Embedding SpellChecker to the pages with HTML Forms
Revision 09-13-2004

SpellChecker is designed to let you spell check the contents of HTML form elements (<TEXTAREA> and <INPUT type="TEXT">). To add SpellChecker to your HTML page(s), please follow the steps below:
  1. SIGN UP FOR SPELLCHECKER SERVICE
  2. DOWNLOAD & INSTALL SPELLCHECKER COMPONENTS
    1. OVERVIEW
    2. SPCH.JS COMPONENT
    3. SPROXY COMPONENT
  3. MODIFY HTML CODE OF YOUR PAGE(S) TO ADD SPELL CHECK FUNCTIONALITY
    1. EMBED SPCH.JS COMPONENT
    2. EMBED SPELL CHECK BUTTON OR LINK
    3. SAMPLE HTML PAGE
    4. TEST SPELLCHECKER
  4. APPENDIXES
    1. APPENDIX I. IPLANET WEB SERVER CONFIGURATION
    2. APPENDIX II. TOMCAT JAVA SERVER CONFIGURATION
    3. APPENDIX III. LANGUAGES, SUPPORTED BY SPELLCHECKER
SIGN UP FOR SPELLCHECKER SERVICE

Before installing the tool, you are required to register with SpellChecker.net.
If you already have an account you may move on to Step 2. Download & Install SpellChecker Components, if not please Sign Up For Paid SpellChecker Service or Sign Up For Free Trial.

After you have completed the sign up process you will receive a confirmation email with your CustomerID, password, and spch.zip archive containing spch.js file, which is one of SpellChecker components

NOTE: SpellChecker files contain customer-specific information therefore borrowing them from another site will be of no use.

   ↑ Top of page

DOWNLOAD & INSTALL SPELLCHECKER COMPONENTS

2.1. OVERVIEW

SpellChecker contains the two components:
° spch.js - JavaScript file, which will be downloaded from your server and will be running in the user's browser
° sproxy - this component will be running on your web server. There are several implementations of this component and you will have to select the one that is most appropriate for the platform of your web server
To add SpellChecker service to your site you will have to install both of the components.

2.2. SPCH.JS COMPONENT

2.2.1. DOWNLOAD SPCH.JS COMPONENT
Normally you do not need to download this component as you get this file in spch.zip archive attached to your SpellChecker confirmation email. However, you can always download this file following the instructions below
  • Go to My Account section
  • Log in with your CustomerID and password
  • Click Download JavaScript file link
  • On JavaScript Download page click Download button
  • Save the file to a temporary folder on your computer
2.2.2. INSTALL SPCH.JS COMPONENT
Extract (or copy) spch.js to the directory of your choice:
  • If you want to use SpellChecker for one HTML page, store spch.js in the same directory where this HTML page is stored
  • If you want to use SpellChecker for several HTML pages, store spch.js in a shared web directory, from which it may be downloaded
  • You should not store spch.js in /cgi-bin directory!
NOTE: Spch.js will be running in the user's browser (on the client side) and not on the server so make sure that you do not have any server-side association for .js extension

2.2.3. CONFIGURE SPCH.JS COMPONENT
Spch.js component does not need any configuration in the hosted version of the system.

2.2.4. TEST SPCH.JS COMPONENT
In the address field of your browser, type the URL of spch.js on your web site according to the following pattern - http://myserver.com/mydirectory/spch.js
  • If spch.js component has been installed correctly, you will see a File Download prompt for spch.js file or the code of spch.js file in the window of your browser
  • If you get an error message, please follow the instruction below:
    1. Check that the URL is correct
    2. Go through steps 2.2.1 to 2.2.3 again and make sure the instructions have been followed carefully
2.3. SPROXY COMPONENT

2.3.1. DOWNLOAD SPROXY COMPONENT
  • Go to My Account section
  • Log in with your CustomerID and password
  • Click Download SPROXY script
    • You will see the page with the list of sproxy archives for various platforms
  • Select the appropriate version and click on the corresponding link
  • Save the file to a temporary folder on your computer
2.3.2. INSTALL SPROXY COMPONENT

Create a directory named sproxy in the root directory of your web site. Extract all files from the archive to this directory on your web site location. If, by some reason you can't create directory with the specified name then copy files from archive to other suitable directory (/cgi-bin, /scripts or any other directory where script execution is enabled)
  • The archive contains the following files:
    1. sproxy script. Depend on platform which the script intended for it has corresponded extension - sproxy.pl for Perl version, sproxy.asp for .ASP version, sproxy.cgi for bianry version, etc.
    2. sproxy.ini - configuration file
    3. *.tmpl files - template files

Version-Specific Notes:

  • For Perl users - open sproxy.cgi (sproxy.pl) file in edit mode, check and modify, if needed the first line, containing the information on Perl interpreter location:
    • For UNIX systems - #!/usr/bin/perl
    • For Windows systems - #!c:/perl/bin/perl.exe
  • For Java users - please update the server configuration as explained in
  • For .NET platform - The following additional files are also provided:
    • web.config
    • global.asax
    • bin/sproxy.dll
    These files are required by .NET web application. Settings stored in the configuration file sproxy.ini for other versions of sproxy script are moved to the file web.config. To make sproxy script .NET version working, create a Virtual Application for the directory sproxy (via IIS MMC Console).
2.3.3. CONFIGURE SPROXY COMPONENT
  • Open sproxy.ini with a text editor
  • Set SPROXY_URL parameter = the URL of sproxy script on your web site
For example:
For Perl version - http://myserver.com/sproxy/sproxy.pl
For asp version - http://myserver.com/sproxy/sproxy.asp
For Binary version in cgi-bin directory - http://myserver.com/cgi-bin/sproxy.cgi
For Java version - http://myserver.com/sproxy
2.3.4. TEST SPROXY COMPONENT
In the address field of your browser, type the URL of sproxy on your web site according to the following pattern - http://myserver.com/sproxy/sproxy.cgi?cmd=ver - you have to type the extension of your sproxy version instead of cgi.
  • If the instructions have been followed carefully, the page similar to the screenshot below will appear:
  • If there isn't such a page, please refer to our Support section

   ↑ Top of page

MODIFY HTML CODE OF YOUR PAGE(S) TO ADD SPELL CHECK FUNCTIONALITY

3.1. EMBED SPCH.JS COMPONENT

  • Open the HTML file, where you want to add SpellChecker, in a text editor.
  • In HEAD section add the string according to the following pattern:

    <SCRIPT TYPE="text/javascript" LANGUAGE="javascript" SRC="http://myserver.com/mydirectory/spch.js"></SCRIPT>

    NOTE: If the HTML page and spch.js are located on the same web site, you may specify the relative path:

    <SCRIPT TYPE="text/javascript" LANGUAGE="javascript" SRC="/mydirectory/spch.js"></SCRIPT>

3.2 EMBED SPELL CHECK BUTTON OR LINK

To use SpellChecker you must have a way of triggering the spell check. There are two common ways to invoke SpellChecker: by pressing the button or by clicking on the link.
  • In FORM section add the following string:
For Spell Check button:For Spell Check link:
<INPUT TYPE="BUTTON" VALUE="Spell Check" onclick="doSpell(…);"><A HREF="javascript: doSpell(…);">Spell Check</A>

doSpell JavaScript function has to be called in the following way:
doSpell ('<LANGUAGE_CODE>', <INPUTCONTROLNAME>, document.location.protocol + '//' + document.location.host + '/<Folder>/ <sproxy script> ', true);

Parameter Description Example
<LANGUAGE_CODE> The code of the target language - for details please refer to Appendix III.en
<INPUTCONTROLNAME> The full name of the control to be checked in your formdocument.forms[0].Message
<Folder> The folder where you stored sproxy scriptSp/
Not required for Java-version since you only need to specify the virtual path that was used for mapping 
<sproxy script> Your version of sproxy scriptSproxy.asp

Thus, doSpell JavaScript function has to look like as follows:

NormallydoSpell (en, document.forms[0].Message , document.location.protocol + '//' + document.location.host + '/sp/sproxy.asp', true);
For Java-version doSpell (en, document.forms[0].Message , document.location.protocol + '//' + document.location.host + '/sproxy', true)

NOTE: SpellChecker call is asynchronous. This means that the code flow will proceed to the next statement before the spelling-session is completed.

3.3. SAMPLE HTML PAGE
This is what the HTML code of the sample page has to look like:

before you add SpellCheckerafter you add SpellChecker
<HTML>
  <HEAD>


  …

  </HEAD>
    <BODY>
      <FORM>
      …
        <TEXTAREA NAME=
"Message" …>…</TEXTAREA>


        …




      </FORM>
    </BODY>
</HTML>
<HTML>
  <HEAD>
  …
    <SCRIPT LANGUAGE="javascript" SRC=" http://myserver.com/mydirectory/spch.js">
</SCRIPT>
  </HEAD>
    <BODY>
      <FORM>
      …
      <TEXTAREA NAME=
"Message" …>…</TEXTAREA>
      …
      <INPUT TYPE="BUTTON" VALUE="Spell Check" onclick=" doSpell('en', document.forms[0].Message, document.location.protocol + '//' + document.location.host + '/sp/sproxy.asp', true);">       
      …
      </FORM>
    </BODY>
</HTML>

NOTE: Instead of <TEXTAREA …>, you can use the other HTML form control - <INPUT TYPE="TEXT" NAME="Subject">

This is what the sample HTML page has to look like …

… before you add SpellChecker… after you add SpellChecker

3.4. TEST SPELLCHECKER
  • Go to the page where you have added SpellChecker
  • Type some text in the HTML form element to be checked
  • Click Spell Check button (link)
If Spellchecker has been installed correctly, you will see a new browser window with Spellchecker and the text (see the figure below)


If you are experiencing problems with Spellchecker installation please refer to our Support section or contact us at tech@spellchecker.net

   ↑ Top of page

APPENDIX I. IPLANET WEB SERVER CONFIGURATION
  • Add the following lines to config/servlets.properties file:
    servlet.sproxy.classpath=<PATH_TO_JAR>/Sproxy.jar
    servlet.sproxy.code=com.spellchecker.net.sproxy.SProxy
    servlet.sproxy.initArgs=TEMPLATE_PATH=<PATH_TO_TMPL>/sproxy=Sproxy
    • Replace <PATH_TO_JAR> with the actual path to Sproxy.jar file
    • Replace <PATH_TO_TMPL> with the path to the directory where you stored sproxy.ini and *.tmpl files (i.e. /spellchecker/tmpl)
  • Restart the web server to load the new settings

APPENDIX II. TOMCAT JAVA SERVER CONFIGURATION
NOTE: SpellChecker is tested for Tomcat Java server version 4.0.3.
  • Go to conf subdirectory of Tomcat program directory
  • Find web.xml file and open it with a text editor
  • Add the following template, at the end of the file, after the last tag:
    <servlet>
       <servlet-name>sproxy</servlet-name>
       <servlet-class>com.spellchecker.net.sproxy.SProxy</servlet-class>
       <init-param>
          <param-name>TEMPLATE_PATH</param-name>
          <param-value><PATH_TO_TMPL></param-value>
       </init-param>
    </servlet>

    <servlet-mapping>
       <servlet-name>sproxy</servlet-name>
       <url-pattern>/sproxy</url-pattern>
    </
    servlet-mapping>
  • Replace <PATH_TO_TMPL> with the path to the directory where you stored sproxy.ini and *.tmpl files (i.e. /spellchecker/tmpl)
  • Restart the web server to load the new settings

APPENDIX III. LANGUAGES, SUPPORTED BY SPELLCHECKER

LanguageCode
  American Englishen
  British Englishuk
  Frenchfr
  Germange
  Italianit
  Spanishsp
  Danishdk
  Brazilian Portuguese  br
  Dutchnl
  Norwegianno
  Portuguesept
  Swedishse

SpellChecker.net, PO Box 641697, Los Angeles, CA 90064 USA, Tel +1(310) 287-2001 x801, Fax +1(310) 287-2347
© 1999-2007 SpellChecker.net, Inc. All Rights Reserved.