summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-02-23 09:45:56 +0100
committerClaude Paroz <claude@2xlibre.net>2013-02-23 10:18:08 +0100
commit7ec2a21be15af5b2c7513482c3bcfdd1e12782ed (patch)
tree13c7d8bdaca60c246d6de8166ad3f66f04dc7a58 /docs/ref
parentdcf651c27edff13236fda0a480059b57dbe6e074 (diff)
Fixed #19686 -- Added HTML5 number input type
Thanks Simon Charette for his help on the patch. Refs #16630.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/forms/fields.txt9
-rw-r--r--docs/ref/forms/widgets.txt13
2 files changed, 19 insertions, 3 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index 2e4e779f0c..85650adcf4 100644
--- a/docs/ref/forms/fields.txt
+++ b/docs/ref/forms/fields.txt
@@ -454,7 +454,8 @@ For each field, we describe the default widget used if you don't specify
.. class:: DecimalField(**kwargs)
- * Default widget: :class:`TextInput`
+ * Default widget: :class:`NumberInput` when :attr:`Field.localize` is
+ ``False``, else :class:`TextInput`.
* Empty value: ``None``
* Normalizes to: A Python ``decimal``.
* Validates that the given value is a decimal. Leading and trailing
@@ -580,7 +581,8 @@ For each field, we describe the default widget used if you don't specify
.. class:: FloatField(**kwargs)
- * Default widget: :class:`TextInput`
+ * Default widget: :class:`NumberInput` when :attr:`Field.localize` is
+ ``False``, else :class:`TextInput`.
* Empty value: ``None``
* Normalizes to: A Python float.
* Validates that the given value is an float. Leading and trailing
@@ -621,7 +623,8 @@ For each field, we describe the default widget used if you don't specify
.. class:: IntegerField(**kwargs)
- * Default widget: :class:`TextInput`
+ * Default widget: :class:`NumberInput` when :attr:`Field.localize` is
+ ``False``, else :class:`TextInput`.
* Empty value: ``None``
* Normalizes to: A Python integer or long integer.
* Validates that the given value is an integer. Leading and trailing
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt
index 970901a9ae..7218e41082 100644
--- a/docs/ref/forms/widgets.txt
+++ b/docs/ref/forms/widgets.txt
@@ -389,6 +389,19 @@ These widgets make use of the HTML elements ``input`` and ``textarea``.
Text input: ``<input type="text" ...>``
+``NumberInput``
+~~~~~~~~~~~~~~~
+
+.. class:: NumberInput
+
+ .. versionadded:: 1.6
+
+ Text input: ``<input type="number" ...>``
+
+ Beware that not all browsers support entering localized numbers in
+ ``number`` input types. Django itself avoids using them for fields having
+ their :attr:`~django.forms.Field.localize` property to ``True``.
+
``EmailInput``
~~~~~~~~~~~~~~