diff --git a/book/forms.rst b/book/forms.rst index 384cc9cbd8e..29235ee13b3 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -242,7 +242,7 @@ controller:: $form->handleRequest($request); - if ($form->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { // ... perform some action, such as saving the task to the database return $this->redirectToRoute('task_success');