As You Type Spell Checking

To enable as you type spell checking on a page with text-fields or text-areas (in HTML these are INPUT and TEXTAREA tags)

  1. Ensure the RapidSpell servlet is registered in the web.xml (per 'Installation').
  2. Import RapidSpell-AYT.js to the page, using <script src="a.rapidspellweb?t=r&amp;n=RapidSpell-AYT.js"></script>
    a.rapidspellweb is the servlet registered in your web.xml - the scripts can also be used directly, see 'Installation'
  3. All textboxes (with their id attribute set) will now be as-you-type enabled.
Tip: If the window.onload is being set on the user page, this can block the as-you-type spell checker from initializing properly. It is suggested that either of the following is used;

1. Store the current onload handler and call it explicitly. Eg. if the current code is window.onload=myHandler; then change it to

<script type="text/javascript">
	var existingOnloadHandler = window.onload;
	window.onload=myHandler;
	function myHandler(){
		if(typeof(existingOnloadHandler)=='function') existingOnloadHandler();
		//...current code
	}
</script>

2. Or, assign the onload handler using window.addEventListener (IE9 and others) or window.attachEvent (IE8 down).

If you receive Access Denied errors, add this code to your page (beneath the original src import):
<script type='text/javascript'>
rapidSpell.ayt_helperURL ="<%=request.getContextPath()%>/a.rapidspellweb?t=a";
</script>
If that doesn't help, it may be a cross domain issue, please email support@keyoti.com

Enabling/Disabling spell check on specific text boxes

To disable for specific text boxes
To enable for specific text boxes

Modifying or removing the 'Add' option

Please see the user dictionary topic.

Using a button to trigger spell check, instead of as the user types

In the HEAD of the page, add a Javascript block which calls rapidSpell.ayt_aytEnabled = false;

<script type="text/javascript">
	rapidSpell.ayt_aytEnabled = false;
</script>

Trigger the spell check using Javascript, eg. in a button click handler;

<input type="button" onclick="rapidSpell.ayt_spellCheck(document.getElementById('textBox1'))" value="Spell Check" />

Static mode

In this mode, the spell check is triggered by a button, and the underlines are overlayed in an uneditable box - when the user finishes spell checking the underlines disappear.

<script type="text/javascript">
	rapidSpell.ayt_aytEnabled = false;
	rapidSpell.ayt_staticMode = true;
</script>

Trigger the spell check using Javascript, eg. in a button click handler (in this call we pass 'this' so that the button's text can be changed to match spell check state);

<input type="button" onclick="rapidSpell.ayt_spellCheck(document.getElementById('textBox1'), this)" value="Spell Check" />

Changing UI text

To change the text used in alerts and the context menu, either set the GuiLanguage parameter or to change a specific text, call rapidSpell.ayt_setUIText(language, identifier, newText), eg;

<script type="text/javascript">
	rapidSpell.ayt_setUIText('ENGLISH', 'add', 'Add to dictionary');
</script>

The first argument specifies the language that is being changed (ie for the corresponding GuiLanguage parameter). The second argument specifies the label as follows:

ignoreIgnore once menu item text
ignoreAllIgnore all menu item text
addAdd menu item text
editEdit menu item text (shown in static mode only)
changeAllChange all menu item text
removeDuplicateRemove duplicate menu item text
noSuggestions'No suggestions' menu item text
completeSpell check complete