input file types width both id and name attributes the getElementById method doesn't work

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
13 years ago
12 years ago

People

(Reporter: rotten_eye, Unassigned)

Tracking

1.5.0.x Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: CLOSEME 07/05)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

when I have an input element with type=file and both id and name attributes set the javascript hetElementById() method can't get that form object.

Bad example:

   <input name="blueFile" id="blueFile" type="file" title="lol">

when I execute this peace of code:

   document.getElementByID('blueFile').disabled = true;
  or
   document.formName.blueFile.disabled = true;

I have an javascript error: "blueFile" doesn't have any properties


Good Example:

   <input name="blueFile" type="file" title="lol">

javascript:

   document.formName.blueFile.disabled = true;

it works fine....

With input file types elements you can't use the id and name attributes if you want refer to the object later with javascript.

Reproducible: Always

Comment 1

12 years ago
careful with spelling and casing, a typo in code can be disastrous:
"getElementById" not "getElementByID" not "hetElementById"
Did you actually copy the code, or did you retype it and allow for a typo?
Reporter, do you still see this problem with the latest Firefox 2? If not, can you please close this bug as WORKSFORME. Thanks!
Whiteboard: CLOSEME 07/05
Version: unspecified → 1.5.0.x Branch
(Reporter)

Updated

12 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED

Updated

12 years ago
Resolution: FIXED → WORKSFORME
You need to log in before you can comment on or make changes to this bug.