After submitting a form how can I keep the page in it’s current position, so users can see errors they might have made?

I have a form that resides at the bottom of my page. I am using WordPress and a plugin called Gravity Forms. After I submit the form at the bottom of my home page within the footer div and errors are found it goes to the top of the page and the errors can no longer be seen. This causes an issue with usability. Can someone please tell me how to keep the page at the current position after form is submitted ? The form is using ajax to check for errors.

Related posts

Leave a Reply

3 comments

  1. Simple way: I change the ID of the form, so Javascript of Gravity form can not remove the form.

    /* Change ID to do not allow remove after saving */
        jQuery(".gform_wrapper").each(function(){
            var self=jQuery(this);
            var form_id=self.attr("id").replace("gform_wrapper_","mygform_wrapper_");
            self.attr("id", form_id);
        });
    

    Also, do something after saving:

    jQuery(document).bind('gform_confirmation_loaded', function(event, form_id){
            //Hide loading icon
            jQuery("#gform_ajax_spinner_"+form_id).remove();
        });