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

Ticket #6900 (closed defect: invalid)

Opened 2 years ago

Last modified 1 year ago

[PATCH] Form.serialize does not handle hidden field hack checkboxes

Reported by: remvee Assigned to: mislav
Priority: normal Milestone: 1.x
Component: Prototype Version: 1.1.6
Severity: normal Keywords:
Cc:

Description

The form serialize method does not handle hidden field hack introduced by #169. Instead the hidden field is also serialized resulting in the unchecked value at the server.

Attachments

prototype.patch (0.9 kB) - added by remvee on 12/29/06 09:08:22.
patch to fix this problem
testserialize.html (382 bytes) - added by remvee on 12/29/06 09:09:19.
test html

Change History

12/29/06 09:08:22 changed by remvee

  • attachment prototype.patch added.

patch to fix this problem

12/29/06 09:09:19 changed by remvee

  • attachment testserialize.html added.

test html

12/29/06 09:10:20 changed by remvee

  • summary changed from Form.serialize does not handle hidden field hack checkboxes to [PATCH] Form.serialize does not handle hidden field hack checkboxes.

The patch is for prototype 1.5.0_rc0.

02/07/07 01:28:17 changed by mislav

  • owner changed from sam to mislav.
  • status changed from new to assigned.

03/04/07 18:05:09 changed by mislav

  • status changed from assigned to closed.
  • resolution set to invalid.

Form.serialize mimics the way forms are serialized by browsers. When the checkbox is not checked, it is skipped and the value of the hidden input is sent. When it is checked, both values are sent because browsers don't skip the hidden input - instead, Rails uses only one value (because there are no square brackets).

[6312] adds this test