[jQuery] $.fn.serialize bug?

[jQuery] $.fn.serialize bug?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Tahoma">When i serialize a form i sometimes
get the last input element twice. The first time is the correct value,
and the second time it's blank.
I think the bug is somewhere in these lines:
</font></font><font size="-1"><font face="Tahoma">-----</font></font><font
size="-1"><font face="Tahoma">-----</font></font><font size="-1"><font
face="Tahoma">-----</font></font><font size="-1"><font face="Tahoma">-----</font></font><font
size="-1"><font face="Tahoma">-----</font></font>
<font size="-1"><font face="Tahoma">        var n = this.name</font></font><font
size="-1"><font face="Tahoma"> || par.name;</font></font><font
size="-1"><font face="Tahoma">
        if (!n && p == 'OPTGROUP' && (par =
par.parentNode))
            n = par.name;
        if (n == undefined) return;
        a.push({name: n, value: this.value});
</font></font><font size="-1"><font face="Tahoma">-----</font></font><font
size="-1"><font face="Tahoma">-----</font></font><font size="-1"><font
face="Tahoma">-----</font></font><font size="-1"><font face="Tahoma">-----</font></font><font
size="-1"><font face="Tahoma">-----
And to be more precise i think the code should read:
</font></font><font size="-1"><font face="Tahoma">-----</font></font><font
size="-1"><font face="Tahoma">-----</font></font><font size="-1"><font
face="Tahoma">-----</font></font><font size="-1"><font face="Tahoma">-----</font></font><font
size="-1"><font face="Tahoma">-----
</font></font><font size="-1"><font face="Tahoma">        <b>var n =
this.name;</b>
</font></font><font size="-1"><font face="Tahoma">        if (!n
&& p == 'OPTGROUP' && (par = par.parentNode))
            n = par.name;
        if (n == undefined) return;
        a.push({name: n, value: this.value});
</font></font><font size="-1"><font face="Tahoma">-----</font></font><font
size="-1"><font face="Tahoma">-----</font></font><font size="-1"><font
face="Tahoma">-----</font></font><font size="-1"><font face="Tahoma">-----</font></font><font
size="-1"><font face="Tahoma">-----
If we don't do the change, you get the name of the parent element, but
not the value. Am i correct?
-- Gilles
</font></font>
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/