#1375 SquirrelSpell Form count bug&fix

Compose (426)

This problem/fix involves specifically init.js and
check_me.js in plugins/squirrelspell/js and an
incompatibility with other plugins/addons, those that
use forms.

I easily installed Squirrelmail 1.4.1 using Apache
1.3.27 and PHP 4.3.1 on Slackware 9.0. I started
installing plugins, first was Link Buttons 1.2. Now
every link in the top menu is a form. Then came Notes
1.0. Notes adds yet another button to the menu, and yet
another form. (It may be that a person who installed
notes without Link Buttons gets a link instead of a
button, I didn't check)

The problem is that the text grab commands in the
init.js calls for
opener.document.forms[0].[subject|body].value. This is
fine, when you don't have 8 extra forms at the top of
the page, such that the message composition exists as
form 0, the first on the page.

When you add forms, it tries to get text from a
nonexistent input area, since the form is now
opener.document.forms[8]. (I have 8 buttons preceding
the actual composition area.) What happens is the
SquirrelSpell popup tells me (in Mozilla Firebird 0.6)
the "please wait" message, and then nothing. The status
bar reports "done".

I got the script to run by changing the forms[] value
to 8, of course. Then, while fixing my garbage, I found
that only "Close and Cancel" would close the window.
"Close and Commit" did nothing but warn me that the
spellchecker was not finished, and when the
spellchecker had sctually finished and told me so, my
decision to close and commit did the same: nothing.
That's when I realized that check_me.js was trying to
write to opener.document.forms[0] as well. thanks
javascript console.

I changed the 2 instances of that one in check_me.js,
and it sent back the changes correctly. Now instead of
worrying about the number of forms preceding the
composition form, I found that I could change the
forms[8] to compose and it targeted the correct form
and data.

So call it by name, not number.

line 22:

textToSpell = opener.document.forms[0].subject.value
+ "\n" + opener.document.forms[0].body.value;

should be:

textToSpell = opener.document.compose.subject.value +
"\n" + opener.document.compose.body.value;

line 281-282:


should be:


thanks for a great app



  • Thijs Kinkhorst

    Thijs Kinkhorst - 2003-07-21
    • status: open --> closed-fixed
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2003-07-21

    Logged In: YES

    Fixed, thanks!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks