PHP Spell Check Rich HTML Editors


PHPSpellCheck can be set to spell check all the visual HTML Editors (WYSIWYGs) in the page by setting the Fields property of the SpellCheckButton Class to "EDITORS"

Inline spellchecking using the SpellAsYouType Class is not possible for Editors.

PHPSpellCheck is Compatible with over 200 Rich HTML Editors including:

  • Custom HTML Editors (Automatically Detected)
  • CKEditor
  • FCKEditor
  • TinyMCE Editor (Moxicode)
  • RichArea
  • RTE
  • HTMLArea
  • MicroSoft ASP.NET AJAX Editor
  • Cute Editor
  • YUSASP Edit (Innova)
  • YUI 2: Rich Text Editor
  • All known jQuery Editors
  • ..and many many more WYSIWYGs.


Spell-Checking All Rich Editors In The Page

SourceCode:
$mySpell->Fields = "EDITORS";


Spell-Checking A Specific Rich Editor

SourceCode:
<div id='MyEnclosingDiv'>
...Editor's Textarea / Code...
</div>

<?php

        $mySpell = new SpellCheckButton();
        $mySpell->InstallationPath = "/phpspellcheck/";	  
	$mySpell->Fields = "MyEnclosingDiv";
	echo $mySpell->SpellImageButton();
?>

In some cases - you may wish to target only 1 rich editor. Due to their nature - most rich editors themselves do not have ID attributes to allow us as developers to access them. To access such an editor - just use the ID of any HTML element that wraps the editor.

  • You can add a wrapped div (as above) or just use the id of your form!

Spell-Checking A Specific Rich Editor By its Iframe

SourceCode:
$mySpell->Fields = "IFRAME:0";

We can also access almost any Rich Editor because they are modified iFrame.

The best way is to use this notation:

  • $mySpell->Fields = "IFRAME:0"; // For the first editor on you page
  • $mySpell->Fields = "IFRAME:1"; // For the second editor on you page
  • ... and so forth.

Note: The presence of iFrames in your page may offset the index.