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.
17
17
+-------------+---------------------------------------------------------------------+
18
18
| Rendered as | ``input `` ``color `` field (a text box) |
19
19
+-------------+---------------------------------------------------------------------+
20
+ | Options | - `html5 `_ |
21
+ +-------------+---------------------------------------------------------------------+
20
22
| Inherited | - `attr `_ |
21
23
| options | - `data `_ |
22
24
| | - `disabled `_ |
@@ -41,6 +43,22 @@ element.
41
43
42
44
.. include :: /reference/forms/types/options/_debug_form.rst.inc
43
45
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
+
44
62
Inherited Options
45
63
-----------------
46
64
@@ -83,3 +101,5 @@ The default value is ``''`` (the empty string).
83
101
.. include :: /reference/forms/types/options/row_attr.rst.inc
84
102
85
103
.. 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