473,788 Members | 3,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing colour of validator error messages

I'm having trouble changing the text colour of the validators I'm
using on a webform.

I want the styling to be done using a CSS class that is attached to
the table cell that my validators live in, but this is overriden by
the inline style that is being output by default.

This is what I've tried to override the style so far:
<asp:requiredfi eldvalidator id="YesNoValida tor" runat="server"
errormessage="T his field is required" controltovalida te="YesNoList"
display="dynami c">This field is required</asp:requiredfie ldvalidator>

<asp:requiredfi eldvalidator id="YesNoValida tor" runat="server"
errormessage="T his field is required" controltovalida te="YesNoList"
display="dynami c" cssClass="valid ator">This field is
required</asp:requiredfie ldvalidator>

<asp:requiredfi eldvalidator id="YesNoValida tor" runat="server"
errormessage="T his field is required" controltovalida te="YesNoList"
display="dynami c" style="">This field is
required</asp:requiredfie ldvalidator>

Helen
Nov 18 '05 #1
2 5643

"Helen" <he***@helephan t.com> wrote in message news:33******** *************** **@posting.goog le.com...
I'm having trouble changing the text colour of the validators I'm
using on a webform.

I want the styling to be done using a CSS class that is attached to
the table cell that my validators live in, but this is overriden by
the inline style that is being output by default.

This is what I've tried to override the style so far:
<asp:requiredfi eldvalidator id="YesNoValida tor" runat="server"
errormessage="T his field is required" controltovalida te="YesNoList"
display="dynami c">This field is required</asp:requiredfie ldvalidator>

<asp:requiredfi eldvalidator id="YesNoValida tor" runat="server"
errormessage="T his field is required" controltovalida te="YesNoList"
display="dynami c" cssClass="valid ator">This field is
required</asp:requiredfie ldvalidator>

<asp:requiredfi eldvalidator id="YesNoValida tor" runat="server"
errormessage="T his field is required" controltovalida te="YesNoList"
display="dynami c" style="">This field is
required</asp:requiredfie ldvalidator>

Helen


use ' ForeColor=" " CssClass="<your style class>" ' in your validator.
By using a space for the color you override the default red color.

Hans Kesting
Nov 18 '05 #2
> use ' ForeColor=" " CssClass="<your style class>" ' in your validator.
By using a space for the color you override the default red color.


Thanks :)

Helen
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

195
8630
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local network. I have downloaded, and installed CSE HTML Validator Pro, but I don't get the same results with that as I do with the online validator on W3.org. And I can't upload files to W3.org either, due to all the ASP code I use.
4
1876
by: Mary Ellen Curtin | last post by:
I made a web page (wheee!) and decided to test it (by upload) in the W3C Validator http://validator.w3.org/ I had some errors, but as Bilbo said of Gandalf, "The explanation did not explain." In desperation I clicked randomly and ended up at the WDG Validator http://www.htmlhelp.com/tools/validator/ Their explanation were actually helpful, and wild was my rejoicing when,
8
7425
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type (text/html) for this document is used to serve both SGML and XML based documents, and it is not possible to disambiguate it based on the DOCTYPE Declaration in your document. Parsing will continue in SGML mode."...
7
8989
by: Ed West | last post by:
Hello, I have a simple form with some input boxes. After validation if one fails, then I would like to at the top of the page say something like "The following fields in red are required" and then change the label in front of the textbox or dropdown list to red... is this possible with asp.net? It seems you can only put a RequiredFieldValidator on the page, and if it fails validation then that text is displayed... ? Thanks
8
7837
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the VALUE ENTERED BY THE USER EXISTS IN THE DB , then THE ERROR MESSAGE OF THE COMPARE VALIDATOR SHOULD BE DISPLAYED. For this, I used the reference artiicle "http://msdn.microsoft.com/library/default.asp?url=/library/en-...
3
1298
by: tshad | last post by:
I have a page that is very long so I have set it up to page using <div> to display or hide the different pages. When I get to the last page the user submits the page. This works great, except that if one of the validators finds an error and it isn't on the last page, the user won't see it. What I want to do is know that there is an error on the 2nd page and make that page visible (which would show the validator error message) and the...
2
2360
by: John Dalberg | last post by:
The below html validates correctly on w3.org's html validator when the file has an html extension. When the same file gets an aspx extension, I get the error below from the validator. This tells me that ASP.NET is changing the character encoding in the http header. How can this be corrected so that aspx pages validate correctly? Error Message: "The character encoding specified in the HTTP header (utf-8) is different from the value in...
0
969
by: Paul | last post by:
Hi all, I want to use the same wrapper table and header text for all validator error messages. The validator controls don't appear to supply an easy method for using tags and formatting. What would be the easiest way to use the same table formatting for the error messages without a great deal of code repetition - subclass the validator controls and override a render method? Any thoughts would be appreciated.
37
3680
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry over" when there are <br /tags involved...??? I've tried using <p style="font-weight: bold;"></p>, I've tried <blockquote></blockquote>...I just can't figure how I'm supposed to get the <b></btags to work for all the lines! Surely there must be...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.