inSpell
Please consider switching to our new and improved hosting service: Islandhosting.com
For support call:     778-410-2454

inSpell

inSpell is a pop-up spell checker gadget that you can add to any web form. It supports dozens of language dictionaries.


Current Version

2008-09-05 19:13:54 NEW

Download it now

Note that you can check the version of a web gadget by loading it directly in your browser with the "version" keyword. For example, loading "inspell.php?version" will display the current version and tell you if there is a newer version available.


Installation

To install this web gadget, simply place a copy of inspell.php in your web space. You can change the name to anything you'd like, as long as it ends with ".php". Note that this is an encoded and encrypted PHP file. It will look like gibberish to you, but the web server will know what to do with it. If you make any changes to this file it will cease to function, so be careful to upload it to your site in BINARY mode.


Configuration

When this web gadget runs it will expect to find a configuration file to load settings from. The filename depends on the name that you gave to the web gadget itself. If you named it "inspell.php" then the configuration file must be named "inspell_config.php" (that's an underscore in the middle). If you named it "spellchecker.php" then the configuration file must be named "spellchecker_config.php", and so on.

The configuration file is a PHP script that contains a list of values in the "CONFIG" array. It will look something like this (but normally with many more settings):

<?php
   $CONFIG['Title'] = "Spell Checker";
   $CONFIG['Language'] = "English (US)";
?>

Please note that this is a PHP file, and as such it must start with the <?php tag and end with the ?> tag and each setting must be terminated with a semicolon. String values need to be enclosed in quotes, numeric values do not need quotes. Putting any other PHP code in this file may cause the web gadget to function incorrectly.

Configuration Settings

$CONFIG['Title']
This is the title to use for the pop-up browser window. If you don't set this then the default is "Spell Checker".

$CONFIG['PanelPosition']
The spell checker window contains two main parts: the control panel where you select alternate words, set your language, etc. and the area where the text that is being spell checked is displayed. This value can be set to "top", "bottom", "left", or "right" to control where the control panel is positioned. The default is "top".

$CONFIG['Language']
This is the default language dictionary to use.

$CONFIG['MinWordLength']
This is a number that controls the minimum length that a word must be to be spell checked. Words shorter than this are ignored. the default value is 3.

$CONFIG['EnableLookups']
If this value is set to "yes" then links to Reference.com's dictionary and thesaurus will be displayed in the control panel, allowing users to perform word lookups.

The Form Itself

After installing the web gadget and creating the configuration file, you need to create the web form that will invoke the web gadget. This is a normal web form and we assume that you know how to create one. The only thing you really need to do to the form itself is make sure it has a name so that the web gadget can reference it. For example, if you wanted to name it "george" your form tag would begin like this:

<form name="george" method="post" action=....
Somewhere on the form page you'll need to add a link, image, or button that opens a new window and calls the web gadget. You need to pass it the name of the form as well as a list of input fields that should be spell checked. For example, if your form is named "george" and it contains an input field named "message", you might add a button like this:

<input type=button value="Spellcheck"
   onclick="window.open( 'inspell.php?form=george&fields=message',
   'spellcheck', 'height=450,width=600,resizable' ); return false;">
The button opens a new window that is 600 pixels wide and 450 pixels high that loads the inspell.php gadget and passes it the form name of "george" and the field list of "message". if you named the web gadget something other than "inspell.php", make sure you change that here as well.

To spell check multiple input fields in a single go, list them all separated with commas.


Example:

To view a working example, click here.

To view the HTML form used in this example, click here.

To view the configuration file used in this example, click here.