This project is archived and is in readonly mode.
HTML5 form field helpers (email_field_tag, etc.)
Reported by Stephen Celis | January 3rd, 2010 @ 07:05 PM | in 3.0.2
As HTML5 becomes more popular, it would be nice to have convenience methods for the new input types.
This patch includes and tests the following:
email_field_tag
(andemail_field
)url_field_tag
(etc.)telephone_field_tag
(aliased tophone_field_tag
)number_field_tag
range_field_tag
search_field_tag
All of the above function on (Mobile) Safari and Opera, and all will gracefully degrade across other browsers.
Comments and changes to this ticket
-
Stephen Celis January 5th, 2010 @ 02:34 PM
Additional patch that merely fixes the "text_field type: override" bug.
Discussion here: http://groups.google.com/group/rubyonrails-core/browse_thread/threa...
I still think that we should prefer adding the helpers, as well, to encourage their use.
-
Repository January 14th, 2010 @ 01:03 AM
(from [2835ec6134b1e5b706824b568dfaba24672b7409]) Custom 'type' attribute support for text_field. [#3646 status:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/2835ec6134b1e5b706824b568dfaba... -
José Valim January 14th, 2010 @ 01:08 AM
- State changed from new to resolved
- Assigned user set to José Valim
-
Jeremy Kemper April 5th, 2010 @ 11:57 PM
- Milestone cleared.
- State changed from resolved to open
Let's get the full helpers in. Could you rebase against master?
-
Jeremy Kemper April 6th, 2010 @ 12:02 AM
Interested in seeing autofocus and placeholder support with javascript fallback, too, if anyone wants to tackle in another ticket.
-
Repository April 6th, 2010 @ 12:08 AM
- State changed from open to committed
(from [f8730e5ce6bba4de7639ac09c6c193458038f748]) Added all the new HTML5 form types as individual form tag methods (search, url, number, etc) (Closes #3646) [Stephen Celis] http://github.com/rails/rails/commit/f8730e5ce6bba4de7639ac09c6c193...
-
michaelxavier April 9th, 2011 @ 04:33 AM
Hate to necro but is there any possible way to get this backported to 2.X? It is surprisingly painful to retrofit existing forms with HTML5 input types.
-
Justin French April 9th, 2011 @ 06:22 AM
@michaelxavier is it really that painful? text_field(:user, :email_address, :type => :email) has worked pretty well for me.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3646 HTML5 form field helpers (email_field_tag, etc.) (from [f8730e5ce6bba4de7639ac09c6c193458038f748]) Added a...
- 3646 HTML5 form field helpers (email_field_tag, etc.) (from [2835ec6134b1e5b706824b568dfaba24672b7409]) Custom ...