Change background color in text field using validator

I have several required text fields with RequiredFieldValidators on my web page. With a validation group for the resume and several classes around it (div's, in the text box itself)

I found many examples of how to do this, but none of them have a validation group. If I add a validation group, the background color will not change; if I remove the Validationgroup, the background color will be changed, but the summary will not show any errors.

I tried with jQuery and C # still not have the result, does anyone have a working example or link? I prefer customer permission for optimization reasons.

Thanks in advance.

+4
source share
1 answer

http://savotdane.blogspot.com/2008/10/hightlight-or-change-background-color.html I hope this link helps you. or you can call the function on click click buttons that have

var val = Page_ClientValidate(); if (!val) { var i = 0; for (; i < Page_Validators.length; i++) { if (!Page_Validators[i].isvalid) { $("#" + Page_Validators[i].controltovalidate) .css("background-color", "red"); } } } return val; 
+2
source

Source: https://habr.com/ru/post/1387848/


All Articles