Skip to content

Commit 8a5ac31

Browse files
committed
The method renderForm generate a 422 Unprocessable Entity if the form is invalid. So we can’t pass in the success method. I suggest to replace it with the complete method.
1 parent 0a9558a commit 8a5ac31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

form/dynamic_form_modification.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,11 +568,11 @@ field according to the current selection in the ``sport`` field:
568568
url : $form.attr('action'),
569569
type: $form.attr('method'),
570570
data : data,
571-
success: function(html) {
571+
complete: function(html) {
572572
// Replace current position field ...
573573
$('#meetup_position').replaceWith(
574574
// ... with the returned one from the AJAX response.
575-
$(html).find('#meetup_position')
575+
$(html.responseText).find('#meetup_position')
576576
);
577577
// Position field now displays the appropriate positions.
578578
}

0 commit comments

Comments
 (0)