Spell Check any Field or Fields By their Id


PHPSpellCheck can be set to spell check one or multiple fields by their ID attribute. This is done using the Fields property of either the SpellCheckButton or SpellAsYouType Class.

The ID can refer to any Textarea, Text Input, HTML Element or IFrame.


Spell Checker Dialog Example

SourceCode:
<textarea id='MyField' ></textarea>


<?php
# PHP Spell Check 1 Field in a Pop-up Dialog
require "/phpspellcheck/include.php";
$mySpell = new SpellCheckButton();
$mySpell->InstallationPath = "/phpspellcheck/";
$mySpell->Fields = "MyField";
echo $mySpell->SpellImageButton();
?>


Inline Spell Check Example

SourceCode:
<textarea id='MyField' ></textarea>

<?php
# PHP Spell Check 1 Field in Situ
$mySpell = new SpellAsYouType();
$mySpell->InstallationPath = "/phpspellcheck/";
$mySpell->Fields = "MyField";
echo $mySpell->Activate();
?>


Targeting Multiple Fields

To target multiple fields - use a comma separated list of Ids:


SourceCode:
$mySpell->Fields = "MyField1,MyHTMLElement2,MyIFrame3,MyTextInput4";