[SOLVED] Spell check in textarea (longshot question)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

is that the ENTIRE spellmesasage.js code that you posted, i have a feeling it isn't.

Mark
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

The entire script:

Code: Select all

// --------------------------------------------------------------------
// phpSpell Javascript (For the PHPBB Message Document)
//
// This is (c)Copyright 2003, Team phpSpell.
// --------------------------------------------------------------------
        var ie4 = (document.all) ? 1:0;
        var gecko=(navigator.userAgent.indexOf('Gecko') > -1) ? 1:0;
        var op6=(navigator.userAgent.indexOf('Opera/6') > -1) ? 1:0;
        var op7=(navigator.userAgent.indexOf('Opera/7') > -1) ? 1 : (navigator.userAgent.indexOf('Opera 7') > -1) ? 1:0;
        var ns4=(navigator.userAgent.indexOf('Mozilla/4.7') > -1) ? 1:0;
        var sf=(navigator.userAgent.indexOf('Safari') > -1) ? 1:0;
        if (op7) ie4 = 0;
        if (sf) {
          ie4 = 0;
          gecko = 1;
        }


        var LinkToField = "";

        function openspell()
        {
          height = 391;
          width = 555;
          if (ie4) LinkToField = self.post.narr;
          if (gecko) {
            LinkToField = parent.document.post.narr;
            height = height + 6;
          }
          if (op6) {
             LinkToField = document.formsї0].narr;
             height = height + 10;
             width = width + 10;
          }
          if (op7) LinkToField = document.formsї0].narr;

          if (!(op6 || gecko || ie4 || op7)) {
            alert("phpSpell only supports one of the following browsers:\nOpera 6+, Netscape 6+, Mozilla 1+, Internet Explorer 4+, Safari");
          } else {
            if (LinkToField.value.length == 0) return;
            directory = "spelling/";
            k = openspell.arguments.length;
            if (k == 1) directory = "";
            win1=window.open(directory+"phpSpell.html","spellcheckwin",'resizable=no,width='+width+',height='+height);
            if (win1.opener == null) win1.opener = self;
          }
          return (false);
        }

        function Opera_Get_Link() {
          return (LinkToField);
        }
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

hmmm...not sure really.

What about naming your form, that maybe a problem. i am just guessing though.

Mark
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

Nope:

Code: Select all

<form method='post' name='reportform' action='subreport.php'>
didn't help the cause.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

Interesting: I changed one line in the script (which I obtained from a 3rd party -- see earlier in this thread):

Code: Select all

if (ie4) LinkToField = self.post.narr;
to
if (ie4) LinkToField = document.forms&#1111;0].narr;
and now everything works fine. (In IE 5.5 at least.) Thanks for the pointer, Mark.
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

Post by SBukoski »

I used the following throughout my web pages:

http://sourceforge.net/projects/spellerpages/

Was pretty simple to setup. Considering I knew nothing about ASpell beforehand. There are a couple requirements, but I think most servers running PHP should meet them. I was able to add a custom dictionary as well that was used throughout the entire site, which was nice.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

That looks interesting, particularly the ability to spellcheck multiple input areas. I ran the demo and it seems to perform very well, but the installation details are pretty sketchy.

Can you tell me what form the dictionary takes? The site refers to "installing a dictionary" but doesn't say what that consists of. Is a standard dictionary included in the download? What provision is included for adding words to the dictionary?

Sorry to bug you with these questions after you were kind enough to point me to the site, but it seems one has to register with the site to ask there. I do appreciate your time.
Post Reply