You can definitely build a custom control that looks through the validation
data. You have to build client-side and server-side support for it.
On the server side, the Page.Validators collection contains the validators.
Each has its own IsValid property that when false, indicates an error.
On the client-side, the Page_Validators array contains a list of HTML
elements (<span> tags) that are the actual validators. Look at the script
file \aspnet_client\system_web\[version]\WebUIValidation.js to study how to
use each element and detect that its valid.
I have built a replacement to Microsoft's validation system. It includes a
much more flexible ValidationSummary control with several new formatting
choices. If you drop me an email describing how you would like to format
your ValidationSummary, I can tell you if and how it works with my software.
("Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx)
--- Peter Blum
www.PeterBlum.com
Email:
PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"darrel" <no*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I have a form that has validators for each field. When I submit the form,
if
the field is invalid, it shows an error next to the field. Works
perfectly.
I also have a label at the top of the form that, if page is NOT valid,
will
display. This message says 'there is a problem with the form, please fix
the
fields below'.
What I'd like to do is have that message also state which of the fields
were
invalid.
I can use a summary validator for that, but that is rather cumbersom in
terms of layout, so I'd like to write out my own message/formatting. Is
there a way to 'get' values from fields that weren't valid?
I imagine I need to call a function, have that function check that
validity
of each field, and then have that return a string?
-Darrel