Closed Bug 15361 Opened 21 years ago Closed 21 years ago

JavaScript is returning undefined for radio button value

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED DUPLICATE of bug 12307

People

(Reporter: marshall, Assigned: vidur)

References

()

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: 21 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.