Created
April 21, 2023 22:49
-
-
Save zecka/7fb9d165b4c44aa75239e024636ed56c to your computer and use it in GitHub Desktop.
Acf advanced form show success message on top of form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment