I have a freemember registration form that is working. However my form is at the bottom of the page. When inline errors are triggered, my form jumps to the top of the page, instead of the top of the form or error.


One way to solve (work around) this is to use some jQuery to check for the presence of errors in your form and then scroll to them if there are any.

if ($('.error').length > 0) {
    $('html, body').animate({
        scrollTop: $('.error').first().offset().top
    }, 2000);

Or to insert a notice at the top of the page prompting the user to scroll down and check for errors in their form.

if ($('.error').length > 0) {
    $('h1').after('<p class="error">There were errors with your submission. Please see below.</p>');

This example assumes you set the Freemember error handling to inline and your error delimiters use the class .error (see the docs).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.