RSS Git Download  Clone
Raw Blame History
<!-- BEGIN site/js/openSpellChecker.tt -->
<script type="text/javascript">
// 
// openSpellChecker()
//
// this function is an example that illustrates the various ways you can invoke
// the the Speller Pages spell-checking process
//
function openSpellChecker() {
	
	// example 1. 
	// Pass in the text inputs or textarea inputs that you 
	// want to spell-check to the object's constructor,
	// then call the openChecker() method.
  /*
	var text1 = document.form.text1;
	var textarea1 = document.form.comment;
	var speller = new spellChecker( text1, textarea1 );
	speller.openChecker();
  */
	// example 2.
	// Rather than passing in the form elements to the object's
	// constructor, populate the object's textInputs property,
	// then call the openChecker() method.
	
	var speller = new spellChecker();
	var spellerInputs = new Array();
	for( var i = 0 ; i < document.[% form_name %].elements.length; i++ ) {
		if( document.[% form_name %].elements[i].type.match( /^text/ )) {
			spellerInputs[spellerInputs.length] = document.[% form_name %].elements[i];
		}
	}
	speller.textInputs = spellerInputs;
	speller.openChecker();
	

	// example 3.
	// use the spellCheckAll() method to check every text input
	// and textarea input in every form in the HTML document.
	// You can also use the checkTextBoxes() method or checkTextAreas()
	// method instead of spellCheckAll() to check only text inputs
	// or textarea inputs, respectively
	/*
	var speller = new spellChecker();
	speller.spellCheckAll();
	*/
}
</script>
<!-- END site/js/openSpellChecker.tt -->