Home > DeveloperSection > Forums > Scrolling a Page after Validation showing Validation Pop Up
Tanuj Kumar

Total Post:134

Points:940
Posted on    August-25-2014 1:19 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 648  View(s)
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



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    August-25-2014 2:19 AM

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);

      }

 }


Don't want to miss updates? Please click the below button!

Follow MindStick