Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6475 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] Form.getInputs always returns array for consistency (and Element.extends each input)

Reported by: savetheclocktower Assigned to: sam
Priority: high Milestone: 1.x
Component: Prototype Version:
Severity: normal Keywords: form getInputs array
Cc:

Description

As Justin Gelfand pointed out in his talk at The Ajax Experience, Form.getInputs returns either an Array or an HTMLCollection depending on the arguments. It should always return an array (so that it can use Enumerable).

Furthermore, I've modified the function to pass each item through Element.extend.

Attachments

form.patch (0.6 kB) - added by savetheclocktower on 10/23/06 20:19:45.
form_test.patch (1.2 kB) - added by savetheclocktower on 10/23/06 20:37:47.
Unit tests

Change History

10/23/06 20:19:45 changed by savetheclocktower

  • attachment form.patch added.

10/23/06 20:37:47 changed by savetheclocktower

  • attachment form_test.patch added.

Unit tests

10/23/06 20:47:04 changed by savetheclocktower

The dude's name is Justin Gehtland. He found this bug, so I owe it to him to get his name right.

12/04/06 10:10:59 changed by madrobby

  • status changed from new to closed.
  • resolution set to fixed.

(In [5675]) Prototype: Make Form.getInputs always return an array for consistency, fixes #6475 [Justin Gehtland, savetheclocktower]