Closed Bug 271629 Opened 20 years ago Closed 20 years ago

Unable to resolve form element name in onClick text

Categories

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

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 267552

People

(Reporter: brataj, Assigned: bugzilla)

References

()

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Page contains code with textarea name="url". Later anchor tag with onClick referring to url receives "Error: url is not defined". The same code works fine in MSIE, K-Meleon. It also works in Firefox using the explicit reference document.forms[0].elements[0] instead of url. Reproducible: Always Steps to Reproduce: 1. Paste text into textarea. 2. Click one of the options on the right. Actual Results: Javascript Console shows "Error: url is not defined". Expected Results: Name url should have been resolved to document.forms[0].elements[0] automagically.
With the simple testcase based on your description, it seemed to work for me, using Mozilla1.7 and the latest trunk build. Could you perhaps send me the page, by e-mail? Thanks.
Component: General → DOM: Level 0
Product: Firefox → Core
Version: unspecified → Trunk
Attached file Testcase
Ok, Bernie sent me the page (thanks Bernie!). This is basically what he wants be able to do in Mozilla. This works in IE6 and Opera7.5. The code of that page consists of this: <html><head></head> <body> <form> <textarea name="url" cols="80" rows="12"></textarea> <a href="javascript://" onClick="alert(url);">alert(url)</a> </form> </body> </html> This could very well be already a bug about this somewhere.
I recommend W3C DOM. *** This bug has been marked as a duplicate of 267552 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: