I'm trying to set the page focus to the validation summary at the top of a form once validation has been run, current the page scroll just stays where it is. I've tried various javascript methods but haven't been able to get any to work.
function ValidateField(source, arguments) {
arguments.IsValid = true;
if (arguments.Value == "") {
arguments.IsValid = false;
//document.getElementById(NWF$('.RequestorName')).focus()
//window.scrollTo(0, 0);
//document.location.href = '.nf-validation-summary';
//document.getElementById('.nf-validation-summary').focus();
//NWF$('.nf-validation-summary').focus();
//NWF$(window).scrollTop(0);
//NWF$(document).scrollTop(0);
//NWF$('html, body').animate({ scrollTop: 0 }, 0);
}
}
Any help with getting the focus of the page, or page to scroll to the top once validation has been performed