We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8548
    • 104 Posts
    I have a form that is at the bottom of the page, but on error the page reloads and go to the top of page and form is not visible anymore.

    the question : is it possible to target an anchor en error so that the user sees the form and error rather than think the form was sent?

    thanks

    This question has been answered by Henrik Nielsen. See the first response.

    • discuss.answer
      • 12028
      • 152 Posts
        - A small step for mankind, so why not take two...

        Working with web production, graphic design/workflow, photo and education - but are trying to get a life in between!
        • 8548
        • 104 Posts
        Thanks a lot, wonder why I did not find it today, past arround 3 hours looking for it, sometime one word changes all the result.

        should have tought of that,

        thanks again, juste love the community!
          • 44649
          • 68 Posts
          Script we made today to scroll to .error when its not empty
          	
          	<script>
          		$(document).ready(function () {
          			var errorDiv = $('.error:not(:empty)').first();
          			var scrollPos = errorDiv.offset().top-150;
          			$('html,body').animate({scrollTop: scrollPos}, 1500);
          		});
          	</script>
          


          This will scroll the an .error span if validation failed, but only works after the page has already been submitted.