Reset Validation Client side

In many situation, even though validation might have succeeded or failed, when we click Reset button, we would want to hide away all validations. Here’s an easy way to do it, – total client end.

<script language="javascript" type="text/javascript">
        function ResetValidation() {
            for (var i = 0; i < Page_Validators.length; i++) {
                var val = Page_Validators[i];
                val.style.display = 'none';
                val.isvalid = true;
            }
            ValidatorUpdateIsValid();
            ValidationSummaryOnSubmit();
        }
    </script>

Advertisements
This entry was posted in General ASP.Net C#. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s