Microsoft's validation controls are not really designed for client-side
expandability. For example, if you took the suggestion of setting focus to a
field with the error, how would you write code that finds the first field
with the error and connect it up to Microsoft's scripts that fire when the
button is pressed. You will do some creative hacking to figure it out.
I want to let you know about an alternative that solves this. I rewrite
ASP.NET validation in "Professional Validation And More"
(
http://www.peterblum.com/vam/home.aspx). It has 22 validators, support for
validation groups, and support for many more browsers in client-side
validation, like Mozilla, Opera 7 and Safari.
I listened to developers who were asking for many enhancements to ASP.NET
and addressed their needs. In your case, you will find these features:
1. There is an option to have it set focus to the first field with the error
upon submit or after you change a field. It can also change the style of
fields with errors, blink the error message, and put up an alert.
2. My ValidationSummary control can offer hyperlinks on its error messages.
When you click on a hyperlink, it jumps to the field with that error.
3. My ValidationSummary control has a setting that makes the page scroll to
show it when you click submit.
I include a utility to quickly switch a page from Microsoft's to my
validators.
--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx