SpellCheckAsYouType (SCAYT)

SCAYT allows the user to see and correct misspellings while typing. Misspelled words are underlined. User just needs to right-click a marked word and select a suggestion to replace the word with.

Dynamic form creation with SCAYTTextArea and SCAYTInput

Installation Guide

1. Please specify source path to Hosted SCAYT loader (see sample, line 10) and encrypted customerID (see sample, line 8):

src="http://svc.webspellchecker.net/scayt26/loader_Textbox.js"

scaytConfig = {customerid: "encrypted-customer-id"}

Please specify source path to Licensed SCAYT loader (see sample, line 12):

src="[ your host ]/spellcheck/lf/scayt/loader_Textbox.js"

2. Dynamically create a form. See sample, lines 9-36

3. Add SCAYTTextArea control to the textarea tag: new scayt.Textarea({ srcNodeRef: textareaNode }); . See sample, line 35

4. Add SCAYTInput control to the input tag: new scayt.Input({ srcNodeRef: inputNode }); See sample, line 34.

Sample


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	//Please specify your encrypted customerID
    <script type="text/javascript"> scaytConfig = {customerid: "encrypted-customer-id"}  </script>
   	//Path to SCAYT loader for Hosted Customers
	 <script type="text/javascript" src="http://svc.webspellchecker.net/scayt26/loader_Textbox.js"></script>
	//Path to SCAYT loader for Licensed Customers
	<script type="text/javascript" src="[your_spellcheck_host]/spellcheck/lf/scayt/loader_Textbox.js"></script>

    <script type="text/javascript">
	function createNewForm() {
		document.body.removeChild(document.body.getElementsByTagName("input")[0]);
		var formObj=document.createElement('form');
		document.body.appendChild(formObj);
		formObj.appendChild(document.createTextNode("SCAYT Input"));
		formObj.appendChild(document.createElement('br'));
		var inputObj=document.createElement('input');
		inputObj.setAttribute("type", "text");
		inputObj.setAttribute("size", 120);
		inputObj.setAttribute("maxlength", 120);
		inputObj.setAttribute("value", "This is an exampl of a sentence with two
			mispelled words. Just type text with misspelling to see how it works.");
		inputObj.setAttribute("name", "demo_input");
		formObj.appendChild(inputObj);
		formObj.appendChild(document.createElement('br'));
		formObj.appendChild(document.createElement('br'));
		formObj.appendChild(document.createTextNode("SCAYT TextArea"));
		formObj.appendChild(document.createElement('br'));
		var textareaObj=document.createElement('textarea');
		textareaObj.setAttribute("rows", 5);
		textareaObj.setAttribute("cols", 90);
		textareaObj.setAttribute("name", "demo_textarea");
		formObj.appendChild(textareaObj);
		textareaObj.appendChild(document.createTextNode("This is an exampl of a sentence with
			two mispelled words. Just type text with misspelling to see how it works."));
		new scayt.Input({ srcNodeRef: inputObj });
		new scayt.Textarea({ srcNodeRef: textareaObj });
	}
	</script>
</head>
<body>
	<input type="button" value="Dynamically create a form with SCAYTTextArea and SCAYTInput"
					onclick="createNewForm();" />
</body>
</html>