Integrating Spell Checking into your Coldfusion Applications
During our quest for a spelling solution, we at Redballoon found a very nice ajax plugin that allows you to add a spell checker into any textarea in your application.
Introducing GoogieSpell.
What is so brilliant about this plug in is its "gmail" like functionality. While this plug in appears to be out of the box it has one very major limitation.
While the author provides solutions for php/perl/asp there was not yet a coldfusion solution available on the site.
So we sat down and developed a coldfusion implementation that slides nicely into our labs blog (Ray Camden's Blog CFC).
Here is the solution we came up with.
Once you have called in the 3 javascripts and the 1 css just put an 'id' on your textarea and instead of calling this that is straight out of the demo.html
googie1.decorateTextarea("ta1");
call this
googie1.decorateTextarea("ta1");
So essentially all we are doing is calling our coldfusion page instead of the google page directly.
Now, we did have to change one thing in the core "googiespell.js" as it was not passing the form scope correctly across to our coldfusion page.
We changed the createXMLReq from
to
return 'textstring=' + text;
}
And then all we have to do is the http call on the coldfusion page "googleapi.cfm?"
Which you can copy and paste from below
<cfsavecontent variable="xmlpacket"><?xml version="1.0"?><spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1"><cfoutput>#tostring(form.textstring)#</cfoutput></spellrequest></cfsavecontent>
<cfhttp method="post" url="https://www.google.com/tbproxy/spell?lang=en" result="xmlresult">
<cfhttpparam value="#tostring(xmlpacket)#" type="body">
</cfhttp>
<cfcontent reset="true" type="text/xml"><cfoutput>#xmlresult.filecontent#</cfoutput>
There were many ways we debugged what was going on and one of the most useful ways was using a firefox extension "live headers". This allowed us to log and watch LIVE what each page was passing to each other.
If you would like to know more regarding this project or how to implement it into your application please feel free to leave a comment and we will do our best to help out.

Can anyone give me any ideas?
Anyone stuck in the past and using MX6.1 will need to alter googiespell/googleapi.cfm slightly. Remove result="xmlresult" from the CFHTTP call on line 3, and change the CFOUTPUT to be cfhttp.filecontent. Enjoy.
Posted By Dave Quested | 7/4/06 5:37 PM
First of all, this looks like a perfect solution for us, and I wanted to thank you for putting it together.
Unfortunately, we are having trouble getting the script to work, even after the June 22 update. We are running ColdFusion 7 on an Apache 2 Server on a Windows 2003 box. I have set up a test page at http://harvest.cals.ncsu.edu/demo.cfm , but it seems to just churn and churn. I noticed that the Coldfusion 6 user above mentioned he thought he might be having problems because of a firewall. We've also got a firewall, so could it be as simple as allowing Google's IP address to have access to our server?
Also, you mentioned a dummy test page in your last response. Could you post that for us to try out too?
Thanks for any help you can provide us!
Scott
Please disregard my previous message. With some help from another CF guy in our office, we were able to get it working on MX and on 6.1
Thanks again for your work on this!
Scott
let me know if you require any more assistance.
http://jamasoftware.com/blog/?p=12
HTTP/1.1 302 Found
Location: http://www.google.com
Date: Fri, 22 Sep 2006 11:05:52 GMT
Content-Type: text/html
Server: GFE/1.3
Content-Length: 218
Connection: Close
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com">here</A>.
</BODY></HTML>
Could you explain me, what does it mean?
May be Google's script has another address now?
<cfsetting showdebugoutput="false">
<cfhttp method="post" url="https://www.google.com/tbproxy/spell?lang=en&h...
<cfhttpparam type="body" value="#GetHttpRequestData().content#" />
</cfhttp>
<cfcontent reset="true" type="text/xml"><cfoutput>#xmlresult.filecontent#</cfoutput>
For 6.1, replace xmlresult with cfhttpcontent
For 7, add result="xmlresult" as an attribute to cfhttp.
http://editor.asbrusoft.com/hardcore/webeditor/ind...
to no avail. as you can see here:
http://distance.jhsph.edu/bau/spell/
the normal no frills version works fine, the one w/ the rich text editor built in doesn't.
any ideas? the way the editor gets built is it actually creates the text area (if you create the editor with a name of wikiEditor, for instance, the text field's id is wikiEditor_textarea). as you can see the googiecheck sees the text field but it seems as if it is not checking the text.
--Scott
@Scott, what did you do to get this running behind your firewall. I believe I'm having the same problem here. I get mine going, but it hangs and hangs...
Someone please help...?
thanks
TIA
:-)
:-(
From firebug:
<?xml version="1.0" encoding="UTF-8"?><spellresult error="1"/>
on googiespell.js line 220
OLD CODE:
return val.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
NEW CODE:
return val.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/%/g, "");
I checked all the images: they all have "https" link (indicator.gif, ok.gif...). The only think I guess which might cause this issue is we use "XMLHTTP" request to the google web service... Does anyone know how to fix this?
Thanks,
I got googiespell working on our CF7 server/win2003/IIS
question1, we are looking into licensing it and besides the owner's $50 fee are there any other fees you are aware of?
And I have been researching google's APIs and they all require a key to use them. Right now we are testing the googiespell in a test environment and I am assuming we are using the owner's key. Where and how would I use the company key?
Also,
We are planning on getting CF8 in the near future and one of the key features is a new RTF editor which is basically the FCKEditor. Has anyone been able (or know any sites) on how to use Googiespell with the FCKEditor? I am still researching and tweaking this but cannot find a solution.
TIA!
I've tried applying the various fixes described in previous messages, with no success.
The spell checker is on machines with ColdFusion MX 7, Windows XP and IIS 6 or later. It has been placed on machines that are outside the local firewall as well.
Are there other issues that need to be addressed to get this to work okay?
Any suggestions would be greatly appreciated. Thanks.
Here is what I did to get it to work:
0) make sure the script code on your page is within cfoutput.
1) make sure you are on a CF version that handles cfhttp.
2) make sure you are pointing to the right directory.
I used the firefox extension firebug. This showed me any and all errors on the console.
I need help!
i have an error with #toString(form.textstring)#. i think it is not work on my cold fusion version. i can do?
forgive my English and thanks
An error occurred while evaluating the expression:
#toString(form.textstring)#
Error near line 9, column 14.
Error resolving parameter FORM.TEXTSTRING
The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name.
The error occurred while processing an element with a general identifier of (#toString(form.textstring)#), occupying document position (9:13) to (9:39) in the template file
http://www.fotolog.com/upskirt2/about
http://www.fotolog.com/upskirt3/about
http://www.fotolog.com/upskirt4/about