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

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top