Scrolling a Page after Validation showing Validation Pop Up

Total Post:134

Points:940

 1224  View(s)
Ratings:
Rate this:

i have a button on the bottom of the page OnClick it validates the form fields and if there is no valid field it displays a pop up message to enter the required fields using asp.net Validation Summary Control.

 I want that when it showing the pop up once user click on OK buttom of pop up window then it should scroll to top of the page to form area. 

Does any one have idea how to handle this to jump the page up?

 I am working in asp.net 3.5 +VS 2010. 

Thanks

  1. Re: Scrolling a Page after Validation showing Validation Pop Up

    Hi Tanuj, 


    Find a form element or the form and scrollTo() it:

     function scrollToElement(id)
     {
          var formElement = document.getElementById(id);
          if(formElement){
              window.scrollTo(0, formElement.offsetTop);
          }
     }

      Modified On Apr-04-2018 07:00:40 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.