From 8a5ac3137501f9c4ae7b7e930c6ae89b5a1505ce Mon Sep 17 00:00:00 2001 From: Yoann Chocteau Date: Thu, 25 Nov 2021 19:43:46 +0100 Subject: [PATCH] =?UTF-8?q?The=20method=20renderForm=20generate=20a=20422?= =?UTF-8?q?=20Unprocessable=20Entity=20if=20the=20form=20is=20invalid.=20S?= =?UTF-8?q?o=20we=20can=E2=80=99t=20pass=20in=20the=20success=20method.=20?= =?UTF-8?q?I=20suggest=20to=20replace=20it=20with=20the=20complete=20metho?= =?UTF-8?q?d.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- form/dynamic_form_modification.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/form/dynamic_form_modification.rst b/form/dynamic_form_modification.rst index 30d53efb780..01694ad9653 100644 --- a/form/dynamic_form_modification.rst +++ b/form/dynamic_form_modification.rst @@ -568,11 +568,11 @@ field according to the current selection in the ``sport`` field: url : $form.attr('action'), type: $form.attr('method'), data : data, - success: function(html) { + complete: function(html) { // Replace current position field ... $('#meetup_position').replaceWith( // ... with the returned one from the AJAX response. - $(html).find('#meetup_position') + $(html.responseText).find('#meetup_position') ); // Position field now displays the appropriate positions. }