#512 document.forms.0.elements.0.type

closed-fixed
nobody
None
5
2002-01-18
2002-01-18
Anonymous
No

Hello All,

I've been playing with 1.2.2. Big grin! Nice work!

One thing I did find, however :

In "src/addressbook.php", there is a block of code
that starts on line 260 with the following code :

echo '<FORM ACTION="' . $PHP_SELF . '"
METHOD="POST">' . "\n";
while(list($undef,$row) = each($alist)) {
.
.
.
echo '</FORM>';

This block of code needs to be surrounded with an "if"
wrapper like :

if(count($alist) > 0)
{
.
.
.
}

Otherwise an empty address book results in a
Javascript error :

Error: 'document.forms.0.elements.0.type' is not an
object

The body tag is attempting to set the focus to the
first text element of the first form on the page.
When the first form on the page has zero controls, the
conditional in the body's javascript code fails.

Of course, there's probably a better solution :-) But
this was a quick and dirty fix that worked for me.

Hope this helps,
--Kyle

Discussion

  • Wouter Teepe
    Wouter Teepe
    2002-01-18

    • status: open --> closed-fixed