|
|
Subject:
ASP.NET RequiredFieldValidator changing font color of field name
Category: Computers > Programming Asked by: royafork-ga List Price: $2.00 |
Posted:
22 Nov 2004 12:08 PST
Expires: 06 Dec 2004 14:04 PST Question ID: 432434 |
I would like to know if there is a way to use the RequiredFieldValidator in such a way that would turn the label "Street Address" red (see below) if the field were left blank and submitted. Currently I only see the ability to add error text beside the field. Is it possible to use the RequiredFieldValidator with an existing label, and if so, how? Street Address [ ] |
|
There is no answer at this time. |
|
Subject:
Re: ASP.NET RequiredFieldValidator changing font color of field name
From: sujitnair-ga on 26 Nov 2004 09:16 PST |
You can add the required field validator to an existing text field in the following way <asp:textbox ID="Street" runat="server" TextMode="SingleLine" TabIndex="1" CssClass="text" /> <br> <asp:RequiredFieldValidator id="StreetValidator" runat="server" ErrorMessage="Enter a street address" ControlToValidate="Street" CssClass="text" Display="Dynamic"/> You can change the css class to alter the colour of the error message. |
Subject:
Re: ASP.NET RequiredFieldValidator changing font color of field name
From: royafork-ga on 29 Nov 2004 08:54 PST |
Thanks, that is very helpful. Is there a standard method for loading a new stylesheet on Postback in ASP.NET? Or a recommended way of changing the style for that one particular CSS element? |
Subject:
Re: ASP.NET RequiredFieldValidator changing font color of field name
From: royafork-ga on 29 Nov 2004 10:26 PST |
Actually, sorry, this does not help, because the RequiredFieldValidator only registers after a Postback. Where is the ErrorMessage text on the initial page load and how do I get it to display? |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |