Skip to content

HTML5 range documentation #5458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 16, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions reference/forms/types/range.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. index::
single: Forms; Fields; range

range Field Type
================

The ``range`` field is a slider that is rendered using the HTML5
``<input type="range" />`` tag.

+-------------+---------------------------------------------------------------------+
| Rendered as | ``input`` ``range`` field (slider in html5 supported browser) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML5

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and you need to remove some spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically the editor was having Soft wrap at preferred length turned on . I changed it. Thanks.

+-------------+---------------------------------------------------------------------+
| Inherited | - `data`_ |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add include for data option.

| options | - `disabled`_ |
| | - `empty_data`_ |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add include for empty_data option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @snoek09 actually I have a question regarding the inherited options and include. I actually copied this from email.rst or something I guess. So is it all the properties of the text field for it is parent the properties are imported ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EmailType and RangeType both have the same type as a parent; text (TextType).

The parent type of text is form (FormType).
The inherited options are from this form type:

http://symfony.com/doc/current/reference/forms/types/text.html

Copy link
Contributor Author

@harikt harikt Jun 30, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `max`_ |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. Anyone have idea how many spaces should be kept ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need one more in this and in the next line (have a look at the right most | character).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, min and max are no options of the form type. You need to pass them as attr option keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be we need attr here.

| | - `min`_ |
| | - `required`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`text </reference/forms/types/text>` |
+-------------+---------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\RangeType` |
+-------------+---------------------------------------------------------------------+

Basic Usage
-----------


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove one of the blank lines.

Inherited Options
-----------------

These options inherit from the :doc:`form </reference/forms/types/form>`
type:

.. include:: /reference/forms/types/options/attr.rst.inc

.. include:: /reference/forms/types/options/disabled.rst.inc

.. include:: /reference/forms/types/options/error_bubbling.rst.inc

.. include:: /reference/forms/types/options/error_mapping.rst.inc

.. include:: /reference/forms/types/options/label.rst.inc

.. include:: /reference/forms/types/options/label_attr.rst.inc

.. include:: /reference/forms/types/options/mapped.rst.inc

.. include:: /reference/forms/types/options/read_only.rst.inc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add read_only to inherited options list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • read_only_ (deprecated as of 2.8) , do we need to add ? May be remove it from docs ?


.. include:: /reference/forms/types/options/required.rst.inc