I have a page where I want to log every check message that the user has not met the requirements for the corresponding field.
The problem is that my feedback / button request never arises (possibly due to client checking) and therefore logging never happens before the user actually gets each field on the right (without validation errors).
Button event event method:
protected void btnNext_Click(object sender, EventArgs e) { Page.Validate(); if(Page.IsValid) {
Any ideas how I could record these posts?
Edit:
<script type="text/javascript"> function validatePage() { if (window.Page_IsValid != true) { //Page_Validators is an array of validation controls in the page. if (window.Page_Validators != undefined && window.Page_Validators != null) { //Looping through the whole validation collection. for (var i = 0; i < window.Page_Validators.length; i++) { window.ValidatorEnable(window.Page_Validators[i]); //if condition to check whether the validation was successfull or not. if (!window.Page_Validators[i].isvalid) { var errMsg = window.Page_Validators[i].getAttribute('ErrorMessage'); alert(errMsg); } } } } } </script>
KLIM8D
source share