WDJ98338
asked on
How to change the textbox background color when the Regular expression shows an error?Bookmark:Question:
Instead of using the error message "Error" I would like to change the textbox txtzipcode background red using CSS can this be done.
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtzipcode" runat="server"></asp:TextB ox>
<asp:RegularExpressionVali dator ID="ValZipcode" runat="server"
BorderStyle="None" ControlToValidate="txtzipc ode"
ErrorMessage="Error"
ValidationExpression="^((\ d{5}-\d{4} )|(\d{5})| ([AaBbCcEe GgHhJjKkLl MmNnPpRrSs TtVvXxYy]\ d[A-Za-z]\ s?\d[A-Za- z]\d))$"
ForeColor="#FF3300"></asp: RegularExp ressionVal idator>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtzipcode" runat="server"></asp:TextB
<asp:RegularExpressionVali
BorderStyle="None" ControlToValidate="txtzipc
ErrorMessage="Error"
ValidationExpression="^((\
ForeColor="#FF3300"></asp:
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.