Home   Free Applications   Code Snippets   Fun Stuff 
 
 You are here: Home > Free Applications > NetSpell > Articles
Register   Login  

 
Site Navigation


Print Print this page
Email E-mail this page
Bookmark Add to Favorites

 
How to integrate NetSpell with FreeTextBox

Posted by on Thursday, March 25, 2004 (EST)

The following code snippet show how intergrate NetSpell with FreeTextBox.

Download the latest version of FreeTextBox and NetSpell.

Copy NetSpell.SpellChecker.dll to the bin folder and add the following files to the same folder as default.aspx for FreeTextBox.

  • spell.css
  • spell.js
  • SpellCheck.aspx 

Copy the dic folder to the FreeTextBox folder.  Then modify the web.config file so the path to the dic folder matches.

<configuration>
    <appSettings>
        <add key="DictionaryFolder" value="dic" />
    </appSettings>
</configuration>

Modify Default.aspx to look like this

<script language="JavaScript" src="spell.js" type="text/javascript"></script>
<FTB:FREETEXTBOX id="FreeTextBox1" runat="Server">
    <TOOLBARS>
        <FTB:TOOLBAR runat="server">
            <FTB:NetSpell runat="server" />
</FTB:TOOLBAR> </TOOLBARS> </FTB:FREETEXTBOX>

Now when you run the web site there should be a new toolbar that has a spell check button.  When the spell check button is clicked, NetSpell should load and start checking the text in the FreeTextBox.

You can look in the demo\Demo.Web.FreeTextBox folder of the latest package of NetSpell for an example of how to integrate NetSpell with FreeTextBox.

3.x UPDATE:

As of FreeTextBox 3.0, NetSpell is intergrated.  The sample code above has been update to reflect what is needed in 3.0


Comments:

Excellent
By ? on Tuesday, August 10, 2004 (EST)

Hi

Just wanted to say thanks for a great component that works excellently with another cool component - FreeTextBox.

Cheers

Dan Goodwin

http://www.themanfromdelmonte.co.uk

Reply to this Comment

Does it work freetextbox 3.0?
By ? on Tuesday, December 21, 2004 (EST)
Thanks for a great article. I've tried and tested it successfully with freetextbox version 2.0. Does this work with the newer version of freetextbox control too? Thanks

Reply to this Comment

Integrating with the FreeTextBox 3.0
By ? on Tuesday, December 21, 2004 (EST)

private void Page_Load(object sender, System.EventArgs e)

{

objFTB = new FreeTextBox();

objToolBar = new Toolbar();

objToolBar.Items.Add(new FontFacesMenu());

objToolBar.Items.Add(new FontSizesMenu());

objToolBar.Items.Add(new ToolbarSeparator());

//Add any other toolbar buttons here

FreeTextBoxControls.NetSpell objNetSpell = new FreeTextBoxControls.NetSpell();

objToolBar.Items.Add(objNetSpell);

objFTB.Toolbars.Add(objToolBar);

}

Hope this helps. There is no need to add any call for a javascript function now.

-Naveen

Reply to this Comment

Problems with FreeTextBox 3.0
By ? on Tuesday, December 21, 2004 (EST)

Actually for  the FreeTextBox 3.0 when the buffer is really big, could take more than 30 seconds for NetSpell to load. Please advice!

Albert

Reply to this Comment

NetSpell doesn't get text of freetextbox in firefox
By ? on Friday, January 28, 2005 (EST)
Hello: I use netspell with freetextbox but in IE works correctly but in Firefox CurrentText.Value hasn't the text. Anyone can help me?

Reply to this Comment

netspell /freetextbox does not work with Netscape
By ? on Thursday, February 17, 2005 (EST)
Could you guys look into the freetextbox control with Netspell added in Netscape. It does not seem to be working in Mozilla based browsers. Any help would be great!! Thanks, Sam.

Reply to this Comment

Review
By ? on Friday, March 11, 2005 (EST)
Thanks - it worked really well for me. Jonathan Stewart http://www.jonathanstewart.co.uk

Reply to this Comment

Reply
By ? on Friday, March 11, 2005 (EST)
<a href="http://www.jonathanstewart.co.uk">Jonathan Stewart</a>

Reply to this Comment

NetSpell in Firefox
By ? on Monday, March 14, 2005 (EST)

I think I was able to make NetSpell work in Firefox. In the spell.js file you need to modify the getText() and setText() functions.

For iframes in Firefox, it uses contentDocument, whereas IE uses document.

So under the IFRAME case in getText(), I changed the code to the following:

...
case "IFRAME" :
var oFrame = eval(oElement.id);
if(oFrame.contentDocument)
{
     sText = oFrame.contentDocument.body.innerHTML;
}
else
{
     sText = oFrame.document.body.innerHTML;
}

You'll have to make a similar change to setText():

...
case "IFRAME" :
var oFrame = eval(oElement.id);
if(oFrame.contentDocument)
{
     oFrame.contentDocument.body.innerHTML = text;
}
else
{
     oFrame.document.body.innerHTML = text;
}
break;

Reply to this Comment

FreeTextBox 3 integration problem
By MarkAurit on Monday, March 21, 2005 (EST)

Ive implemented ftb 3.0, and other than a AutoGenerateToolbarsFromString="false" directive in my .ascx file, everything is in codebehind.  Ive copied in the aspx, js, and css, and put the entry in web.config, and created the instance of NetSpell and added it to the tool.

When I run the app and click on the spell icon, I get  the dialog box “Netspell Libraries not properly linked”.  There are references to ftb and netspell.

Thanks much, Mark

Reply to this Comment

aspx after implementing 3.0
By ? on Thursday, March 24, 2005 (EST)

Naveen

How much of the below is needed after implementing your procedure?

Thanks much, Mark

<script language="JavaScript" src="spell.js" type="text/javascript">script>
<FTB:FREETEXTBOX id="FreeTextBox1" runat="Server">
    <TOOLBARS>
        <FTB:TOOLBAR runat="server">
            <FTB:TOOLBARBUTTON title="SpellCheck" runat="server" FunctionName="FTB_SpellCheck" ButtonImage="spellcheck">
            function FTB_SpellCheck(ftbName)
            {
                checkSpellingById(ftbName + "_Editor");
            }
            FTB:ToolbarButton>
        FTB:TOOLBAR>
    TOOLBARS>
FTB:FREETEXTBOX>

Reply to this Comment

Literal Content
By ? on Tuesday, March 29, 2005 (EST)

ASPX - Whether I code this in C# or VB.. I keep getting this error

 Literal content ('function FTB_SpellCheck(ftbName) { checkSpellingById(ftbName + "_Editor"); } </FTB:TOOLBARBUTTON>') is not allowed within a 'FreeTextBoxControls.Support.ToolbarItemCollection'.

just wanted to know had anyone else gotten this error..and if so what did you do?!

Thanks!

Reply to this Comment

Literal
By ? on Wednesday, March 30, 2005 (EST)
I did get the above error, but I used Naveen's approach and it works fine. Also, has anyone been able to get it to work on Netscape 7.2? modifying the javascript functions get it working on firefox but not netscape.

Reply to this Comment

Re: Literal Content
By ? on Friday, April 01, 2005 (EST)

Thanks for your reply regarding Naveen...

I've tried that and it is still not working for me (Converted it to VB)... what is in your aspx page. I have to be missing something!

Reply to this Comment

NetSpell 2.1.8 Coming Soon
By pwelter34 on Friday, April 01, 2005 (EST)

Hi All,

Sorry for not keeping up on things here.  I've updated the articale above to work with FreeTextBox 3.0.  I'm going to release NetSpell 2.1.8 soon to address a couple of issues.  This release will have the fix posted above to get Firefox working.  The release will also have a fix for the non braking space issue. 

Thanks
~ Paul

Reply to this Comment

Thanks!!!!
By ? on Monday, April 04, 2005 (EST)

Thanks soo much. It worked like a charm..

I can't believe that was it! Wonderful application!

Reply to this Comment

Cool stuff
By ? on Thursday, April 28, 2005 (EST)

Your utility is really cool.

I have been looking for a spellcheck and this one would fit in right.

Although, I have not been able to implement it in my asp.net project. The C# code was not helpful.

Can you please post a code snippet in VB to use netspell with a regular textbox web control?

Thanks,

Reply to this Comment

Error integrated Netspell in FreeTextBox
By ? on Monday, May 09, 2005 (EST)

I have installed and successfully used FreeTextBox 3.0.3 in my ASP.NET (VB) project.  When I try to integrate NetSpell using:

<script language="JavaScript" src="spell.js" type="text/javascript"></script>
<FTB:FREETEXTBOX id="FreeTextBox1" runat="Server">
    <TOOLBARS>
        <FTB:TOOLBAR runat="server">
            <FTB:NetSpell runat="server" />
</FTB:TOOLBAR> </TOOLBARS> </FTB:FREETEXTBOX>

I get an error that says:

Type 'FreeTextBoxControls.FreeTextBox' does not have a property named 'ftb:toolbars'.

Any help would be greatly appreciated.

Thanks,

ES

Reply to this Comment

bug with FTB plus other inputs
By ? on Friday, May 13, 2005 (EST)
I want to perform NetSpell on an entire form with multiple inputs plus an FTB. I do not want to spellcheck just the FTB individually. The spell check works but the replace does not work for the FTB. When I click replace, the spellcheck contiues but the error in the FTB is not replaced. This only happens in the FTB design tab. In the FTB HTML tab it works correctly. Any ideas?

Reply to this Comment

Netspell in vb.net
By ? on Thursday, June 02, 2005 (EST)
 

Your utility is really cool.

I have been looking for a spellcheck and this one would fit in right.

Although, I have not been able to implement it in my asp.net project. The C# code was not helpful.

Can you please post a code snippet in VB to use netspell with a regular textbox web control?

Thanks,

Reply to this Comment

RE: FreeTextBox 3 integration problem
By bwinfrey on Tuesday, June 14, 2005 (EST)
I see you posted some time ago, but thought I would reply anyway. I had the same problem. you need to add the link to the java script file. <script language="JavaScript" src="spell.js" type="text/javascript"></script>

Reply to this Comment

Cool Tool
By bwinfrey on Tuesday, June 14, 2005 (EST)
Thanks

Reply to this Comment

addint net spell in the PageLoad()
By ? on Friday, July 29, 2005 (EST)
This works great!!! thank you so much...

Reply to this Comment

Error
By ? on Sunday, September 18, 2005 (EST)
I did exactly what you instructed and but get the following error on IE6: Error spellcheck.aspx Line 136 Error: document.spellingform isnull or not an object Can someone please help

Reply to this Comment

SpellCheck.aspx ERROR
By ? on Thursday, September 22, 2005 (EST)

I have the same error.

 Is there some bugs with spell.js and spellcheck.aspx?  When I click the spellcheck symbol I get the following error msg.

document.SpellingForm is not an object or null.

 

Reply to this Comment

Possible fix for document.SpellingForm
By ? on Friday, September 23, 2005 (EST)
I edited spell.js and it worked. I change the line: document.SpellingForm.submit(); to document.forms[0].submit(); Start at line 135. Jason

Reply to this Comment

Re: spell.js fix
By ? on Monday, September 26, 2005 (EST)

Good fix it works for me.

Reply to this Comment

Similar Mozilla Problems
By ? on Thursday, October 27, 2005 (EST)
I'm having a similar problem with Mozilla browsers.  It works fine in IE, but with the same mispellings the Spell Check dialog box pops up disabled and the alert message immediately displays spell check complete with FireFox.  I've updated the getText() and setText() functions as you've recommended, but that hasn't resolved the problem.  I'd appreciate any other suggestions.  Thanks!

Reply to this Comment

NetSpell in Firefox - This works!!
By ? on Wednesday, November 30, 2005 (EST)
As proposed earlier you need to modify the getText() and setText() functions in the spell.js file. Beside the contentDocument/document trouble, firefox doesn't like the eval() function. So under the IFRAME case in getText(), Change the code to the following: ... case "IFRAME" : if (oElement.contentDocument) { sText = oElement.contentDocument.body.innerHTML; } else { var oFrame = eval(oElement.id); sText = oFrame.document.body.innerHTML; } You'll have to make a similar change to setText(): ... case "IFRAME" : if (oElement.contentDocument) { oElement.contentDocument.body.innerHTML = text; } else { var oFrame =eval(oElement.id); oFrame.document.body.innerHTML = text; } break; This works in both IE6 and firefox 1.5

Reply to this Comment

NetSpell in Firefox - This works!! (now with formating ;-) )
By ? on Wednesday, November 30, 2005 (EST)

As proposed earlier you need to modify the getText() and setText() functions in the spell.js file.

Beside the contentDocument/document trouble, firefox doesn't like the eval() function.

So under the IFRAME case in getText(), Change the code to the following:

...
case "IFRAME" :
if (oElement.contentDocument)
{
  sText = oElement.contentDocument.body.innerHTML;
}
else
{
  var oFrame = eval(oElement.id);
  sText = oFrame.document.body.innerHTML;
}

You'll have to make a similar change to setText():

...
case "IFRAME" :
if (oElement.contentDocument)
{
  oElement.contentDocument.body.innerHTML = text;
}
else
{
  var oFrame =eval(oElement.id);
  oFrame.document.body.innerHTML = text;
}
break;


This works in both IE 6 and firefox 1.5.

By the way your "Add comments" form, doesn't perform well with firefox 1.5....

Reply to this Comment

that works
By ? on Saturday, January 21, 2006 (EST)
the above comment (dated Wednesday, November 30, 2005) with a fix for Firefox works well for IE and Firefox 1.5. Thank you!

Reply to this Comment

Free Text Box
By bhoirmadhura on Tuesday, September 19, 2006 (EST)
I am using Free Text Box for adding/Editing a content. In FireFox it Works fine But in IE for Editing A content the it was giving me a javascript error that this.Freetextbox.readonly Kindly suggest me ASAP madhura

Reply to this Comment

My favourite pharma supermarket www.world-viagra.com
By mymalifexx on Wednesday, April 02, 2008 (EST)
+1 Best wishes, Alex http://www.world-viagra.com - my favourite pharma shop

Reply to this Comment

Add Your Comment



Top
 
SourceForge.net: Project Summary: NetSpell - .net Spell Checker (netspell project)


A summary of key project details for the netspell project on SourceForge.net.

  • Project name: NetSpell - .net Spell Checker
    Project description: NetSpell is a free spell checking engine for the .net framework.

  • Developers on project: 1
    Project administrators: pwelter34

  • Activity percentile (last week): 92.32%
    Most recent daily statistics ( 5 Sep 2008): Ranking: 17498, Activity percentile: 92.32%,

  • Downloadable files: 55954 total downloads to date
    Most recent daily statistics ( 5 Sep 2008): Download count: 46

  • Mailing lists (public): 0
    Public mailing lists:

  • Tracker: Bugs (11 open/11 total)
    Tracker description: Bug Tracking System

  • Tracker: Support Requests (18 open/18 total)
    Tracker description: Tech Support Tracking System

  • Tracker: Patches (1 open/1 total)
    Tracker description: Patch Tracking System

  • Tracker: Feature Requests (8 open/8 total)
    Tracker description: Feature Request Tracking System


    Copyright and acceptable usage information for this RSS feed may be found at: http://sourceforge.net/docman/display_doc.php?docid=6048&group_id=1#licensing_and_other_terms Last Refreshed 9/5/2008 3:36:24 PM
  •