Finally got it with af/form/ajax/submission javascript action located on advanced-forms/assets/js/forms.js into onSuccess method
(It would be nice to add this javascript action in the documentation)
acf.addAction('af/form/ajax/submission', (data, form) => {
// Reset data.type to prevet af perform success message injection onSuccess
// check --> advanced-forms/assets/js/forms.js
data.type = false
const $form = $('#'+form.key);
// Insert success message right before the form DOM element
$(data.success_message).insertBefore($form)
})
-
This reply was modified 3 years, 3 months ago by
zecka1213.
Hi @zecka1213,
Glad you managed to figure out a way to handle this. I’ve got this slotted in for a future release but at present, the form is replaced by the success message.
Cheers,
Phil