File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -671,6 +671,22 @@ their type::
671
671
// Upload a file
672
672
$form['photo']->upload('/path/to/lucas.jpg');
673
673
674
+ .. versionadded :: 2.4
675
+ The :method: `Symfony\\ Component\\ DomCrawler\\ Form::disableValidation `
676
+ method was added in Symfony 2.4.
677
+
678
+ By default, choice fields (select, radio) have internal validation activated
679
+ to prevent you from setting invalid values. If you want to be able to set
680
+ invalid values, you can use the ``disableValidation() `` method on either
681
+ the whole form or specific field(s)::
682
+
683
+ // Disable validation for a specific field
684
+ $form['country']->disableValidation()->select('Invalid value');
685
+
686
+ // Disable validation for the whole form
687
+ $form->disableValidation();
688
+ $form['country']->select('Invalid value');
689
+
674
690
.. tip ::
675
691
676
692
You can get the values that will be submitted by calling the ``getValues() ``
You can’t perform that action at this time.
0 commit comments