Nanospell Spell Checking Software Components
JavaScript jQuery CKEditor TinyMCE PHP ASP.Net Classic ASP

PHP SpellChecker

JavaScript & AJAX API

  1. 1 Installation outside of PHP Applications
  2. 2 Scripting & PHPSpellCheck
  3. 3 Class LiveSpellInstance
    1. 3.1 Core Properties
      1. 3.1.1 CaseSensitive
      2. 3.1.2 CheckGrammar
      3. 3.1.3 CSSTheme
      4. 3.1.4 Fields
      5. 3.1.5 FormToSubmit
      6. 3.1.6 IgnoreAllCaps
      7. 3.1.7 IgnoreNumeric
      8. 3.1.8 Language
      9. 3.1.9 SettingsFile
      10. 3.1.10 UserInterfaceLanguage
    2. 3.2 Setup Properties
      1. 3.2.1 CustomOpener
      2. 3.2.2 CustomOpenerClose
      3. 3.2.3 ServerModel
      4. 3.2.4 Delay
      5. 3.2.5 WindowMode
      6. 3.2.6 Strict
      7. 3.2.7 ShowSummaryScreen
      8. 3.2.8 ShowMeanings
      9. 3.2.9 MeaningProvider
      10. 3.2.10 UndoLimit
      11. 3.2.11 HiddenButtons
    3. 3.3 Methods
      1. 3.3.1 checkInWindow()
      2. 3.3.2 checkInSitu()
      3. 3.3.3 activateAsYouType()
      4. 3.3.4 pauseAsYouType()
    4. 3.4 Rendering Methods
      1. 3.4.1 url()
      2. 3.4.2 DrawSpellButton ([inPlace] [,text] [,Class] [,style] )
      3. 3.4.3 DrawSpellImageButton ([inPlace] [,image] [,rollover] [,text] [,Class] [,style])
      4. 3.4.4 DrawSpellLink ([inPlace] [,text] [,Class] [,style])
      5. 3.4.5 SpellButton ([inPlace][,text][,Class][,style])
      6. 3.4.6 SpellLink ([inPlace][,text][,Class][,style])
      7. 3.4.7 SpellImageButton ([inPlace][,image,][,rolloverImage][,Class][,style])
    5. 3.5 Javascript Events
      1. 3.5.1 onDialogOpen()
      2. 3.5.2 onDialogComplete()
      3. 3.5.3 onDialogCancel()
      4. 3.5.4 onDialogClose()
      5. 3.5.5 onChangeLanguage(Language)
      6. 3.5.6 onIgnore (Word)
      7. 3.5.7 onIgnoreAll (Word)
      8. 3.5.8 onChangeWord (From, To)
      9. 3.5.9 onChangeAll (From, To)
      10. 3.5.10 onLearnWord (Word)
      11. 3.5.11 onLearnAutoCorrect(From,To)
      12. 3.5.12 onUpdateFields(arrayOfFieldIds)
    6. 3.6 AJAX Methods
      1. 3.6.1 AjaxSpellCheck(word, makeSuggestions)
      2. 3.6.2 AjaxSpellCheckArray(arrayOfWords, makeSuggestions)
      3. 3.6.3 AjaxDidYouMean(inputString)
    7. 3.7 AJAX Events & Callbacks
      1. 3.7.1 onSpellCheck (word, spelling, reason, suggestions)
      2. 3.7.2 onDidYouMean(suggestion, original)

For Runtime control and integration with non PHP Languages

Installation outside of PHP Applications

The JavaScript API allows developers the choice to use all of PHPSpellCheck's functionality using JavaScript as the integration language. This also allows PHPSpellCheck to be implemented within non-php applications.

  1. Ensure that phpspellcheck is installed in the website root (and test this installation using the examples).
  2. Use JavaScript to implement PHPSpellCheck. Example code in javascript can be generated using the API explorer on our homepage

e.g.

<script src="/phpspellcheck/include.js' type='text/javascript'></script>
<script type='text/javascript'>
var mySpell = new LiveSpellInstance();
mySpell.Fields = "ALL"
mySpell.DrawSpellImageButton()
mySpell.ActivateAsYouType()
</script>

Scripting & PHPSpellCheck

You can access your existing PHPSpellCheck AsYouType and SpellButton objects in JavaScript using their ID attribute as their JavaScript object name. Both the AsYouType and SpellButton PHP objects create an instance of the JavaScript LiveSpellObject class documented below.

<?php
        require "/phpspellcheck/include.php";   
        $mySpell = new SpellCheckButton();
        $mySpell->InstallationPath = "/phpspellcheck/";  
        echo $mySpell->SpellImageButton();
?>      
        
<script type='text/javascript'>
        var mySpellObject = <?php echo ($mySpell->ID)?>;

        mySpellObject.onDialogOpen = function(){
                alert("onDialogOpen event fired")               
        }

</script>

Class LiveSpellInstance

Core Properties

CaseSensitive

CheckGrammar

CSSTheme

Fields

FormToSubmit

IgnoreAllCaps

IgnoreNumeric

Language

SettingsFile

UserInterfaceLanguage

Setup Properties

CustomOpener

CustomOpenerClose

ServerModel

Delay

WindowMode

Sets the behavior of the spellchecker dialog to either:

Strict

ShowSummaryScreen

ShowMeanings

MeaningProvider

UndoLimit

HiddenButtons

Methods

checkInWindow()

checkInSitu()

activateAsYouType()

pauseAsYouType()

Rendering Methods

url()

DrawSpellButton ([inPlace] [,text] [,Class] [,style] )

DrawSpellImageButton ([inPlace] [,image] [,rollover] [,text] [,Class] [,style])

DrawSpellLink ([inPlace] [,text] [,Class] [,style])

SpellButton ([inPlace][,text][,Class][,style])

SpellLink ([inPlace][,text][,Class][,style])

SpellImageButton ([inPlace][,image,][,rolloverImage][,Class][,style])

Javascript Events

onDialogOpen()

onDialogComplete()

onDialogCancel()

onDialogClose()

onChangeLanguage(Language)

onIgnore (Word)

onIgnoreAll (Word)

onChangeWord (From, To)

onChangeAll (From, To)

onLearnWord (Word)

onLearnAutoCorrect(From,To)

onUpdateFields(arrayOfFieldIds)

AJAX Methods

AjaxSpellCheck(word, makeSuggestions)

AjaxSpellCheckArray(arrayOfWords, makeSuggestions)

AjaxDidYouMean(inputString)

AJAX Events & Callbacks

onSpellCheck (word, spelling, reason, suggestions)

onDidYouMean(suggestion, original)