---
title: "Scrolling a Page after Validation showing Validation Pop Up"  
description: "Scrolling a Page after Validation showing Validation Pop Up"  
author: "Anonymous User"  
published: 2014-08-25  
updated: 2014-08-25  
canonical: https://www.mindstick.com/forum/2122/scrolling-a-page-after-validation-showing-validation-pop-up  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Scrolling a Page after Validation showing Validation Pop Up

i have a [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) on the bottom of the page [OnClick](https://www.mindstick.com/forum/12718/onclick-for-hyperlink) it validates the form fields and if there is no valid field it displays a [pop up](https://answers.mindstick.com/qa/50233/what-to-do-with-the-issues-that-may-pop-up-at-the-time-of-usb-device-installation) [message](https://www.mindstick.com/forum/12802/show-confirmation-message-yes-or-no-in-asp-dot-net) to enter the [required fields](https://www.mindstick.com/forum/160242/how-to-use-data-annotation-to-validate-required-fields) using [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) [Validation](https://www.mindstick.com/articles/12234/validation-using-data-annotation-using-entity-framework) [Summary](https://www.mindstick.com/forum/33860/how-to-calculate-column-summary-in-sql-server) 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](https://www.mindstick.com/articles/311004/suede-skillet-handle-cover) this to jump the page up?

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

Thanks

## Replies

### Reply by Sumit Kesarwani

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);      } }
```


---

Original Source: https://www.mindstick.com/forum/2122/scrolling-a-page-after-validation-showing-validation-pop-up

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
