1

i trying to pop up only error message's for validation's control not text. The code which i tried is showing null for error message's.

function fnOnUpdateValidators() {
            for (var i = 0; i < Page_Validators.length; i++) {
                var val = Page_Validators[i];
                var ctrl = document.getElementById(val.controltovalidate);
                if (ctrl != null && ctrl.style != null) {
                    if (!val.isvalid) {
                        ctrl.style.background = '#FFD6AD';
                        var errMsg = document.getElementById(val.id).getAttribute('ErrorMessage');
                        alert(errMsg);
                    }
                    else
                        ctrl.style.backgroundColor = '';
                }
            }
        }

1 Answer 1

3

You can address the error message with val.errormessage in your code. You don't need to do getAttribute.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.