File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ element.
1717+-------------+---------------------------------------------------------------------+
1818| Rendered as | ``input `` ``color `` field (a text box) |
1919+-------------+---------------------------------------------------------------------+
20+ | Options | - `html5 `_ |
21+ +-------------+---------------------------------------------------------------------+
2022| Inherited | - `attr `_ |
2123| options | - `data `_ |
2224| | - `disabled `_ |
@@ -41,6 +43,22 @@ element.
4143
4244.. include :: /reference/forms/types/options/_debug_form.rst.inc
4345
46+ Field Options
47+ -------------
48+
49+ html5
50+ ~~~~~
51+
52+ **type **: ``bool `` **default **: ``false ``
53+
54+ .. versionadded :: 5.1
55+
56+ This option was introduced in Symfony 5.1.
57+
58+ When this option is set to ``true ``, the form type checks that its value matches
59+ the `HTML5 color format `_ (``/^#[0-9a-f]{6}$/i ``). If it doesn't match it,
60+ you'll see the following error message: *"This value is not a valid HTML5 color" *.
61+
4462Inherited Options
4563-----------------
4664
@@ -83,3 +101,5 @@ The default value is ``''`` (the empty string).
83101.. include :: /reference/forms/types/options/row_attr.rst.inc
84102
85103.. include :: /reference/forms/types/options/trim.rst.inc
104+
105+ .. _`HTML5 color format` : https://www.w3.org/TR/html52/sec-forms.html#color-state-typecolor
You can’t perform that action at this time.
0 commit comments