1

Is it possible to Scroll to the Validation error of the ValidationCalloutExtender?

I have a large page sometimes when I click on a button on the top of the page and If I forgot to enter something in one field located at the end of the page I can't know what exactly is happening on the page unless I happen to scroll down and see the ValidationCalloutExtender popup, is there a way to scroll to the field where the ValidationCalloutExtender has been triggered?

Eric Bergman
  • 1,453
  • 11
  • 46
  • 84

1 Answers1

2

Place this script at very bottom of your page

<script type="text/javascript">
    var originalShow = Sys.Extended.UI.ValidatorCalloutBehavior.prototype.show;
    Sys.Extended.UI.ValidatorCalloutBehavior.prototype.show = function (force) {
        this._elementToValidate.scrollIntoView(false); //true to align with the top of the scroll area
        originalShow.call(this, force);
    };
</script>
Yuriy Rozhovetskiy
  • 22,270
  • 4
  • 37
  • 68
  • The script does force the page to move to the correct position but it does not respect the PopupPosition property of the ValidatorCalloutExtender, I noticed that it puts the popup on random locations. – Eric Bergman Dec 12 '12 at 16:03