I have a simple form with a few required field validators and a validation summary control. When I submit the form, the client validation will cause the form to ju
I use this: (requires jquery and jquery.scrollTo)
First you put an anchor with a specific class above your validation summary, like so:
then include this bit of javascript:
$(document).ready(
function () {
var $valSum = $(".custom_valsum_anchor");
if ($valSum.size() > 0) {
var backup_ValidationSummaryOnSubmit = ValidationSummaryOnSubmit;
ValidationSummaryOnSubmit = function (validationGroup) {
var backup_ScrollTo = window.scrollTo;
window.scrollTo = function () { };
backup_ValidationSummaryOnSubmit(validationGroup);
window.scrollTo = backup_ScrollTo;
setTimeout(function () { $("body").scrollTo($valSum); }, 1);
};
}
}
);
Basicaly, it replaces, when necessary, the ValidationSummaryOnSubmit function with a version that temporarily disables window.scrollTo and scrolls to the anchor. It should not be to hard to modify so that it does not use jquery.