This project is archived and is in readonly mode.
FormTagHelper generates illegal html if name contains e.g. square brackets
-
DHH
Please turn this into a real patch with tests. Thanks!
-
Repository
- State changed from new to committed
(from [5fad229e43e2b2541ed39c6ef571975176e6a8d2]) Fixed that FormTagHelper generates illegal html if name contains e.g. square brackets [#1238 FormTagHelper generates illegal html if name contains e.g. square brackets state:committed]
Signed-off-by: David Heinemeier Hansson david@loudthinking.com http://github.com/rails/rails/co...
-
Ken Collins
After upgrading to rails 1.2.6 to 2.2, this broke a lot of my manual hidden form tags where I had [] in the IDs. :(
-
Vladimir Dobriakov
@Ken:
This fix only changes the way the ids are automatically calculated. Now they are created according to the HTML 4.01 specification. If you manually provide a name and an id to the hidden_field_tag, then attributes provided by you will be used.
BTW, brackets are not allowed in the id:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_), colons (), and periods (".").
-
Ken Collins
Until this is fixed, it's best to pass in the :id HTML option. For instance
select_tag 'note[to_group_id]', select_options, :id => 'user_groups_select'... select_tag 'parameters[foobar]', options_for_select(...), :id => 'foobar_select'...
