Dialog Spell Checking

All text boxes (within a form on the page) will be spell checked, unless specifically indicated to be ignored

  1. Ensure the RapidSpell servlet is registered in the web.xml (per 'Installation').
  2. Import RapidSpell-DIALOG.js to the page, using <script src="a.rapidspellweb?t=r&amp;n=RapidSpell-DIALOG.js"></script>
    a.rapidspellweb is the servlet registered in your web.xml - the scripts can also be used directly, see 'Installation'
  3. All textboxes (that are inside a FORM element, and have their id attribute set) will be checked when the user triggers the spell check eg. in a button click handler;

    <input type="button" onclick="rapidSpell.dialog_spellCheck()" value="Spell Check" />
    //or for a specific text box
    <input type="button" onclick="rapidSpell.dialog_spellCheck(true, 'textBoxID1')" value="Spell Check" />
    //or for a list of specific text boxes
    <input type="button" onclick="rapidSpell.dialog_spellCheck(true, ['textBoxID1', 'textBoxID2', ...])" value="Spell Check" />
    
If you receive Access Denied errors, add this code to your page (beneath the original src import):
<script type='text/javascript'>
	rapidSpell.dialog_popupURL ="<%=request.getContextPath()%>/a.rapidspellweb?t=d";
</script>
If that doesn't help, it may be a cross domain issue, please email support@keyoti.com

If accented characters and/or smart quotes (eg ’ or “ ”) appear as gibberish characters in the spell check window, it is because the spell checker is expecting the application encoding to be UTF-8. Avoid this by setting the assumed application encoding to the correct encoding (Tomcat defaults to 8859_1 for example):
<script type='text/javascript'>
	rapidSpell.setParameterValue('default', 'AssumedApplicationEncoding', '8859_1');
</script>
We cannot detect the application encoding, you must check the web.xml or any Filters for this.

Disabling spell check on specific text boxes

Modifying or removing the 'Add' option

Please see the user dictionary topic.

Using jQuery UI Dialog instead of a popup

In the Javascript for your page, call

rapidSpell.dialog_setUseDivDialog(true); //use false to deactivate
That will enable a DIV based dialog window, instead of a separate popup. The call to rapidSpell.dialog_setUseDivDialog checks if jQuery is currently loaded for the page (ie. your page already imports jQuery). If jQuery and/or jQuery UI is not present it will be loaded from CDN //code.jquery.com/jquery-1.11.3.min.js and //code.jquery.com/ui/1.11.4/jquery-ui.min.js. It is recommended (and to avoid using the CDN) that you please add jQuery and jQuery UI to your project and page, eg.
<link rel="stylesheet" href="/.../jquery-ui.css" />
<script src="/.../jquery-1.11.3.min.js"></script>
<script src="/.../jquery-ui.min.js"></script>

The jQuery UI Dialog mode uses an AJAX call to the "a.rapidspellweb" Servlet.

Modal mode

To display the spell check dialog modally, call

rapidSpell.dialog_setUseDivDialog(true); 
rapidSpell.dialog_modal = true;

User options

There are several options available to the user via the "Options..." button in the dialog. Any changes to these options will override any settings specified in code. To disable the user options button (and any settings specified by the user), call

rapidSpell.setParameterValue('default', 'EnableOptions', false);

User options are stored in browser cookies and are not transferable to other devices as-is. Options apply to 'as you type' spell checking as well.

jQuery Dialog Troubleshooting

If you get '500' server errors, please check:

We don't want you to struggle, so please email support@keyoti.com if problems persist.