From 71c1d5f534b665ab211516aa493f1d312f1092fe Mon Sep 17 00:00:00 2001 From: Benjamin Sonnet <52417640+Precipitator80@users.noreply.github.com> Date: Tue, 15 Apr 2025 17:52:57 +0100 Subject: [PATCH] minor [Docs] Added guidance for rendering live form validation errors --- src/LiveComponent/doc/index.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/LiveComponent/doc/index.rst b/src/LiveComponent/doc/index.rst index a473881d50b..ad92c857867 100644 --- a/src/LiveComponent/doc/index.rst +++ b/src/LiveComponent/doc/index.rst @@ -1490,6 +1490,10 @@ How this works: #. During that Ajax call, the form is submitted using ``$formValues``, the form re-renders, and the page is updated. +To render validation errors for fields using the ``data-model`` attribute, +you must set ``$this->isValidated = true;`` in the constructor of the live +component using the ``ComponentWithFormTrait``. + Build the "New Post" Form Component ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~