First of all, you need to add a script on your page and define a path to access WSC Dialog. The next step is to initialize the WSC Dialog functionality for chosen elements on the page and define the required options. 2.1. Define a function that will be triggering the WSC Dialog functionality. 2.2. Define the WSC Dialog options. 2.3. Initialize a doSpell() function and pass the previously defined options as an argument. 2.4. Add a button “Proofread” that on-click triggers the WSC Dialog functionality.1. Add Script with WSC Dialog URL
<script type="text/javascript" src="http(s)://your_host_name/spellcheck/script/ssrv.cgi?cmd=script&doc=wsc&schema=118"> </script>
2. Initialize WSC Dialog
<script type="text/javascript">
function init_WSC_Dialog(){
}
</script>
<script type="text/javascript">
function init_WSC_Dialog(){
var options = {
ctrl: 'your_element_id',
lang: 'en_US',
schemaIdentifier: 118
}
</script>
<script type="text/javascript">
function init_WSC_Dialog(){
var options = {
ctrl: 'your_element_id',
lang: 'en_US',
schemaIdentifier: 118
doSpell(options);
}
</script>
<input type="button" value="Proofread" onclick="init_WSC_Dialog();" />
3. Examples
Example 3.1: WSC Dialog Initialization in TEXTAREA
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http(s)://your_host_name/spellcheck/script/ssrv.cgi?cmd=script&doc=wsc"> </script>
<script type="text/javascript">
function init_WSC_Dialog(){
var options = {
ctrl: 'textarea_ID',
lang: 'en_US',
schemaIdentifier: 118
doSpell(options);
}
</script>
<body>
<textarea id="textarea_ID" name="textarea_ID">
This is an exampl of a sentence with two mispelled words.
</textarea>
<input type="button" value="Proofread" onclick="init_WSC_Dialog();" />
</body>
</head>
</html>