'FormElement' in document.forms.formName.elements wrongly returns false

UNCONFIRMED
Unassigned

Status

()

Firefox
General
UNCONFIRMED
7 years ago
7 years ago

People

(Reporter: Brandon Kirsch, Unassigned)

Tracking

3.6 Branch
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101026 SUSE/3.6.12-0.7.1 Firefox/3.6.12

In the following form snippet:

<form name="bugForm">
<input name="inputElement" value="some value">
</form>
<script>
alert(document.forms['bugForm'].elements['inputElement'].value); // "some value"
alert('inputElement' in document.forms['bugForm']); // false, expected true
</script>

I expect 'inputElement' in document.forms['bugForm'] to return true, but it returns false.  I have this problem with 3.6.12 on Linux/32-bit and have verified it also exists on Win7/64-bit Firefox 3.6.12 as well.

Reproducible: Always

Steps to Reproduce:
1. eval(alert('validInputName' in document.forms['validFormName'].elements));
2. Expect "true" since validInputName is a property of document.forms['validFormName'].elements
3. Get "false" instead.
Actual Results:  
Returns false.

Expected Results:  
Returns true.

Updated

7 years ago
Version: unspecified → 3.6 Branch
You need to log in before you can comment on or make changes to this bug.