Spell Check A Frame or iFrame with PHP

PHP Spell Check > Documentation > Tutorials > Spell Check iFrames

PHPSpellCheck can be set to spell check the contents any Frame or iFrame using the Fields property of the SpellCheckButton Class. Inline spellchecking cannot be applied to frames.

Note - that it is not possible to spell-check an iframe that points to a remote domain due to browser XSS security.

Spell-Checking An IFrame By Id

$mySpell->Fields = "myIFrameId";

Setting the field to the ID attribute of your iframe tag is the most specific way to target an Iframe.

Spell-Checking An IFrame By Index

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

In some instances - iFrames may not have Id attributes. In this case - you can acess them by their index in the Frames collection.

  • IFRAME:0 will access the first iFrame in the HTML Document.
  • IFRAME:1 will access the second iFrame in the HTML Document.
  • ...and so forth.