There Is ClientValidationFunction property in Rejex Validation Control
<asp:RegularExpressionValidator ID="REVBankNotes" runat="server"
ControlToValidate="txtBankNotes" ErrorMessage="Enter a Number" ClientValidationFunction="changeColor"
ForeColor="Red" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
function changeColor(source, args) {
var txtuser = document.getElementById('txtUsername');
var txtpwd = document.getElementById('txtPwd');
var txtfname = document.getElementById('txtfname');
var txtlname = document.getElementById('txtlname');
var strimg = new Array();
strimg = [txtuser, txtpwd, txtfname, txtlname];
if (args.Value == "") {
args.IsValid = false;
document.getElementById(source.id.replace('cv','txt')).style.background = 'orange';
}
else {
args.IsValid = true;
document.getElementById(source.id.replace('cv', 'txt')).style.background = 'white';
}
}
http://www.aspdotnet-suresh.com/2011/01/how-to-change-textbox-background-color.html[
^]
http://forums.asp.net/p/1415769/3120520.aspx[
^]