Jason Petersen
0332313300
Fix handling of 'size' attribute on numeric inputs
...
Validators complain that SimpleForm's numeric elements have a `size`
attribute. According to the [spec][1], `input` elements with a `type`
of `number` must not specify a `size`. This change removes the `size`
option, and updates an existing unit test to guard against regressions.
Users may still provide a `size` option manually, though it may produce
invalid markup in certain situations.
[1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html#number-state
2011-08-25 19:42:37 -07:00
Carlos Antonio da Silva
da649740c9
Change use_html5 option to html5
2011-05-16 06:42:58 -03:00
Rafael Mendonça França
12cae98a62
Remove unnecessary code
2011-04-07 21:41:12 -03:00
Wolfram Arnold
25803824eb
Add configuration option to explicitly turn off HTML5 extensions.
...
This includes the new field types such as email, number, search, url,
tel, and the new attributes such as required, autofocus, maxlength, min, max, step.
None of these are technically allowed in the HTML4 or XHTML1.0 doc types.
Test coverage and updated README.
Update config file generator with new HTML5 option.
2011-04-07 21:25:27 -03:00
Fede Soria
5aa43207a3
Default step of "any" for number input
2011-03-17 06:44:47 +08:00
Rafael Mendonça França
1651dc04cf
Fixes numeric fields with validates_numericality_of with symbols and procs
2011-03-12 01:13:49 -03:00
Rafael Mendonça França
baa1740f16
A better name for method
2011-03-11 11:19:39 +08:00
Rafael Mendonça França
cdc4f20f30
Make numeric fields work with validates_numericality_of using symbols and procs
2011-03-11 11:19:38 +08:00
José Valim
ebde237bf2
Move placeholders to a component.
...
This commit changes Inputs::Base to handle input_html_options on initialization and allows components to return nil.
2010-11-07 10:43:20 +01:00
Carlos Antonio da Silva
27ba278b6c
Refactor has errors in both error component and error notification
2010-10-29 01:05:17 -02:00
Rafael Mendonça França
8a85618022
Adding placeholder option to the numeric input
2010-10-13 03:20:49 +08:00
Carlos Antonio da Silva
801634667a
Tidy up previous commits, and fix step attribute
...
The numeric input was generating step="false" instead of skiping
the attribute. Fixed and add some more test cases for non integers.
2010-09-14 00:40:03 -03:00
Daniel Schierbeck
ac9be4e1e6
Move a line of code
...
It makes more sense now.
2010-09-14 10:52:17 +08:00
Daniel Schierbeck
ff3d0b25a7
Only infer min and max from < and > validations on integers
2010-09-14 10:52:16 +08:00
Daniel Schierbeck
927077ca45
Also support < and > validations
2010-09-14 10:52:15 +08:00
Daniel Schierbeck
56c2959bd7
Infer the step attr from the DB column type instead
2010-09-14 10:52:14 +08:00
Daniel Schierbeck
b1b51c56f3
Refactor the code a bit
2010-09-14 10:52:14 +08:00
Daniel Schierbeck
88e6dd51b0
Add a step attribute when a numeric field is integer only
2010-09-14 10:52:13 +08:00
Daniel Schierbeck
abeb06a1db
Set the max attribute when there's a <= validation
2010-09-14 10:52:13 +08:00
Daniel Schierbeck
c81f3ca994
Set the min attribute when there's a >= validation
2010-09-14 10:52:13 +08:00
José Valim
1ef232cf6d
Numberic type inputs now have type=number for HTML5.
2010-06-01 23:40:12 +02:00
José Valim
433f5a7603
Add support for both email and url input types from HTML 5.
2010-02-06 22:21:26 +01:00