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

Ticket #6433 (closed defect: duplicate)

Opened 3 years ago

Last modified 3 years ago

[PATCH] prototype: <select> serialization and empty attributes

Reported by: gracinet Assigned to: sam
Priority: normal Milestone:
Component: Prototype Version:
Severity: normal Keywords: form select serialization
Cc:

Description

The following html fragment:

<option value="" selected="selected">All</option>

gets serialized as with "All" as value. This is because the empty string evaluates as boolean false in statements. The reference I read (HTML 4 RFC) specifies that a *missing* attribute should be replaced by element's text.

The attached patch solves the problem for me. No test included, sorry, I don't have time enough to struggle with the fixture.

Attachments

patch (0.8 kB) - added by gracinet on 10/18/06 12:17:45.
output of svn diff in prototype/src

Change History

10/18/06 12:17:45 changed by gracinet

  • attachment patch added.

output of svn diff in prototype/src

11/04/06 20:16:41 changed by mislav

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

see #4722