[Javascript] JSpell implementation help.
Roger.Espiritu at MAIL.CUNY.EDU
Roger.Espiritu at MAIL.CUNY.EDU
Wed Mar 1 08:26:07 CST 2006
I am trying to implement a JSpell (spellchecker product script from
Soltions Cafe: http://www.thesolutioncafe.com/), to check individual
textboxes for spelling. Before I want to purchase the product from
"Solutions Cafe". I want to have one button image per textbox that checks
their specified textbox.
I've downloaded and tested their JSpell Trial version on my local test
server. The way how JSpell works is that with a button, it checks all
textboxes simulateously. I basically wanted one button per text field. The
folks at Jspell said yes it works and they gave me this code to use to
check for individual textboxes using it's own proprietary image button
(Sample 2 below). I've tested it but I can't get it to work. What only
works for me is with a single button, it checks ALL fields within the
form.
Can someone help me correctly rewrite the script for either samples below
to make this happen. I only know very basic Javascripting.
Sample 1: This sample does work. (with one button checking all
textfields):
----------start------------
<html>
<head>
<script language="JavaScript"
src="http://127.0.0.1/jspellhtml2k4/jspell.js"></script>
<script language="JavaScript">
<!--
function getSpellCheckArray() {
var fieldsToCheck=new Array();
// make sure to enclose form/field object reference in quotes!
fieldsToCheck[fieldsToCheck.length]='document.forms["xlog"].xlog';
return fieldsToCheck;
}
var language;
//-->
</script>
</head>
<body>
<form method="POST" name="xlog">
<textarea cols="10" rows="10" name="xlog">
</textarea>
<img src="../q/img/nav_abc.gif" width="28" height="29" border="0"
value="Spell Check" onClick="spellcheck()" alt="Spell Check">
</FORM>
</body>
</html>
-------end---------
Sample 2: This is what the folks at solutionscafe gave with a button per
textbox... but it doesn't work. I get errors in return.
----------start------------
<html>
<head>
<script language="JavaScript"
src="http://127.0.0.1/jspellhtml2k4/jspell.js"></script>
<SCRIPT type="text/javascript" language="JavaScript">
<!--
function getSpellCheckArray() {
var spellCheckArray=new Array();
return spellCheckArray;
}
//-->
</SCRIPT>
<title>JSpell Test File</title>
</head>
<body>
<form method="POST" enablecab="No" name="scope">
<textarea cols="20" rows="20" name="log"></textarea>
<img src="../q/img/nav_abc.gif" onClick="spellCheckArray=new Array();
spellCheckArray[0]=\"forms[scope].log"; spellcheck(); return false;">
<textarea cols="20" rows="20" name="log2"></textarea>
<img src="../q/img/doc.gif" onClick="spellCheckArray=new Array();
spellCheckArray[0]=\"forms[scope].log2"; spellcheck(); return false;">
</form>
</body>
</html>
-----------------end--------------
Help!
-Roger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060301/ff502d6c/attachment.htm>
More information about the Javascript
mailing list