JavaScript is returning undefined for radio button value

VERIFIED DUPLICATE of bug 12307

Status

()

defect
P3
normal
VERIFIED DUPLICATE of bug 12307
20 years ago
20 years ago

People

(Reporter: marshall, Assigned: vidur)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

()

On, http://www.cyberworldcorp.com/new%20site/products_downloads.html there is a
short piece of javascript which reads the information on the form and writes it
to a cookie.

var product;
for(var i=0;i < document.forms[0].product.length;i++){
   if(document.forms[0].product[i].checked){
      product = document.forms[0].product[i].value;
   }
}

The only problem is, product is returned as undefined in Mozilla, while this
code works in the other 2 browsers.  In the cookie viewer all of the other
information is layed out properly (It reads from selection boxes correctly).
Assignee: mccabe → vidur
Component: Javascript Engine → DOM Level 0
QA Contact: cbegle → desale
not a JavaScript engine bug, it's a DOM thing.  (see
http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser for info on
mozilla components)
There are several radio buttons named "product" in the form; the above script
relies on the accepted behavior that JavaScript places those elements into an
array with the specified name.

It's not clear to me that the DOM specifies this behavior, but in any event it
doesn't work in Mozilla right now.

This looks like a duplicate of bug 12307.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
*** This bug has been marked as a duplicate of 12307 ***
Status: RESOLVED → VERIFIED
Duplicate. Marking verified.
You need to log in before you can comment on or make changes to this bug.