From 44d19defeaf0556c1c014fa717b35267561238cf Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 28 Jul 2015 21:47:56 +0200 Subject: [PATCH] Added example for 'required' => false | Q | A | ------------- | --- | Doc fix? | [yes] | New docs? | [no] | Applies to | [2.3] | Fixed tickets | [] --- book/forms.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/book/forms.rst b/book/forms.rst index dd1bde9c944..3ba6d1c838f 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -679,9 +679,12 @@ the documentation for each type. The most common option is the ``required`` option, which can be applied to any field. By default, the ``required`` option is set to ``true``, meaning that HTML5-ready browsers will apply client-side validation if the field - is left blank. If you don't want this behavior, either set the ``required`` - option on your field to ``false`` or - :ref:`disable HTML5 validation `. + is left blank. If you don't want this behavior, either + :ref:`disable HTML5 validation ` + or set the ``required`` option on your field to ``false``: + + ->add('dueDate', 'date', array('widget' => 'single_text', + 'required' => false)) Also note that setting the ``required`` option to ``true`` will **not** result in server-side validation to be applied. In other words, if a