Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter zecka1213

    (@zecka1213)

    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 1 year, 10 months ago by zecka1213.
    Plugin Author philkurth

    (@philkurth)

    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ajax submit – Success message Keep form’ is closed to new replies.