PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Javascript "jump" on ajax error

  1. tobaccordshow
    Member

    Hi,

    I read through the documentation and didn't see where I could prevent the behavior of the "jump to error" when submitting via AJAX.

    The problem is that I have a "floating" div that follows the user around. Upon submit, GF will attempt to scroll to the location of the first error. However, when doing that, it actually scrolls my page down and the form will then "follow" the user and catch up.

    It's only a one field form and I would love to be able to turn this off.

    Any suggestions?

    Posted 12 years ago on Monday July 11, 2011 | Permalink
  2. I'm not sure if it can be disabled, i'll have to look into it.

    Posted 12 years ago on Monday July 11, 2011 | Permalink
  3. tobaccordshow
    Member

    Thanks, even if it requires editing core, I really have to turn this off. It's killing the navigation.

    Posted 12 years ago on Monday July 11, 2011 | Permalink
  4. Unfortunately there aren't any options to prevent an AJAX form from scrolling upon an error.
    If changing the core is an option for you, you just have to remove line 482 in the form_display.asp file. See screenshot below:
    http://tardis1.tinygrab.com/awF1

    Posted 12 years ago on Monday July 11, 2011 | Permalink
  5. You could do this:

    jQuery(document).bind('gform_page_loaded', function(event, form_id, current_page){
    	jQuery(document).scrollTop(0);
    });

    Not sure how it would affect multi-page forms though.

    Posted 12 years ago on Tuesday September 13, 2011 | Permalink

This topic has been resolved and has been closed to new replies.