Results 1 to 7 of 7

Thread: textarea spell checker

  1. #1
    Join Date
    Apr 2010
    Location
    University of Illinois
    Posts
    86
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default textarea spell checker

    Can anyone point me to a good php spell check script out there. I need this for my textarea but it would be nice if I could also use it for other text fields.

    I found a couple of them...one worked great on my mac but didn't seem to do anything on my pc, another one seemed very top heavy.
    Last edited by I am Abby; 05-28-2010 at 01:30 PM.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    As the user types or after when being submitted? If when the user types it'll need to be javascript or AJAX.
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Many browsers have spellcheckers. If your users want this, just tell them to use Firefox or another good browser.
    I don't see this as an unreasonable request because this isn't saying "my website doesn't work in anything aside from firefox", but that "if you use firefox you can have a spellchecker also!". That seems fine...


    There are some libraries for PHP that deal with language things (such as spellchecking), but it will be complex to set this up. Try looking around at php.net for a function library that might be helpful.
    Here's one: http://us.php.net/manual/en/book.pspell.php

    And yes, this will be very annoying to use if you don't have it work while the user is typing. You can do a "preview" with spell check highlighting the 'incorrect' words, but it won't be anything near a real-time or interactive spellchecker.
    Ajax for this would be possible, I guess, but it would require some very complex Javascript on top of many Ajax queries as the user types. Perhaps the spacebar and punctuation trigger spellcheck? But you'd need to only send one word at a time, unless you want to waste the bandwidth (=speed in ajax) sending the extra data.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Apr 2010
    Location
    University of Illinois
    Posts
    86
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default

    Using my mac I found what looks like a great one. http://www.broken-notebook.com/spell_checker/

    The intentionally misspell dictionary. On my Mac it is underlined with red, if I right click I can choose the correct spelling. When using my PC I don't see a red underline and I can't get the correct spelling by right clicking.

    It doesn't seem to work with my PC

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Text box styling is difficult and just not allowed in some browsers. The browser (not the OS) is important to figure this out, but whatever you do won't work everywhere. It should certainly be possible to get this to work in most of the major browsers, though.

    The PHP in this is fairly "basic" even if complex. The hard part is the Javascript and that's what isn't cross-browser compatible. If that's the script you want to use, then you may want to repost this in the Javascript section to discuss making it cross-browser compatible. I wouldn't know where to start with that.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. The Following User Says Thank You to djr33 For This Useful Post:

    I am Abby (05-28-2010)

  7. #6
    Join Date
    Apr 2010
    Location
    University of Illinois
    Posts
    86
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default

    Funny thing I just went over to my PC to test the spell check here! Same thing happens if I make a spelling mistake using my mac it's underlined with red and I can correct it by right clicking.

    Using my pc to come here...when I make a spelling mistake, nothing! and I don't see any way to fix even if I know the mistake is there.

  8. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Are you referring to the forums? Any textbox will have automatic spellchecking (red dotted underlining) in Firefox and a right click menu lets you select options.
    This is completely unrelated to the content of the page. I would assume it does the same thing on a PC, but maybe not-- I haven't tested that.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •