• Resolved Simon)q

    (@sitelift)


    Hi there

    Firstly I want to say thank you. This plugin has helped me big time. I’ll explain briefly. I’m making a multisite where I want people to be able to create a website from a template and customise that template by filling on some custom fields on some options pages etc.

    I want them to be able to do this without any help, so it must be incredibly easy. One of the hurdles is creating a contact us page. No contact forms have the ability to set the admin email with a custom field, except yours. So it’s literally saved the day.

    One small request though. Most contact forms have the ability to refresh themselves after the user clicks send without refreshing the page. Because I put this contact form in the footer of the page, the user clicks submit and the entire page refreshes and reloads to the top of the page. The contact form and ‘success’ message is down the bottom. The user would be confused and need to scroll down. So it makes for a poor user experience for the user. If I could get it more like say Contact Form 7 where the form reloaded without reloading the page, that would make this damn near perfect ??

    Can you help with this? Is it something that I can enable now easily, or is it something that you’d consider putting into the next release?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi! Very glad to hear AF is working nicely for you.

    I have thought about introducing AJAX-based submissions for a while and it’s definitely something I want to do but unfortunately it’s not a trivial task. It probably won’t be included until the next major release.

    Regarding you problem specifically it can be fixed decently easily. When the page has been reloaded and the submission was successful the form fields will be replaced by a div with class “af-success”. You could write a small piece of Javascript which checks for an “af-success” element and scrolls to it when the page loads. Something like this should suffice:

    
    var $af_success = $('.af-success');
    if ($af_success.length > 0) $(window).scrollTop($af_success.position().top);
    

    Hope this works!

    Hi @sitelift & @fabianlindfors,
    With other people on the ACF support website we try to solve the problem of AJAX with ACF form frontend. I answer with a solution and this one works with ACF form frontend and with af_form too. I hope this one will help you! ??

    https://support.advancedcustomfields.com/forums/topic/frontend-form-post-via-ajax/#post-55583

    Thanks,
    Val

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ajax or no refresh page on submit?’ is closed to new replies.