Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to clear the validation summary without posting back - ASP.NET

139 views
Skip to first unread message

Cleako

unread,
Nov 30, 2005, 1:30:06 PM11/30/05
to
Here is my dilema.

I have a validation summary that I use soley for my Required Field
Validators. I have it setup to run from a Page.Validate call in the
code-behind, this is because I need to be able to clear text or other various
functions need to be checked before it hits the back side.

That works fine if I do things that way up to a point, if by chance the
validation summary says "Date field required" then I edit the date and input
an incorrect date, which I have a JavaScript validation for, that message
will come up saying how to enter the date. The problem is that the
validation summary is now populated and it wont clear until I hit the server
again.

Is there a way to clear it or make it invisible through JavaScript on some
form function like onsubmit - we are using an external JavaScript file so
that everything is available to all pages, that will allow me to be able to
clear that summary? The final product does not need to show a message after
you hit the submit button unless that message is needed and by turning off
the "CausesValidation" property for the button then I lose the ability to
have that updated client side.

So to summarize what I am asking:

a)If there is a way to keep the causes validation property as true and still
be able to clear a result label before running that validation then what do I
need to do?

If that is not possible then.

b)If there is a way to clear out the validation summary or make it disappear
until I hit the server side again AFTER re-submitting the form after making
the necessary changes and possibly having an error caught through JavaScript
which will stop the postback?

Thanks,
Cleako

0 new messages