function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tunedogtunedog 

inputField error message CSS

How do I apply CSS to a field level Error message (eg: a validation rule or a required field)?

 

In my page I have used:

<style type="text/css">
.error{border:1px solid #ff0000;}
label.error{display:block; width:200px; font-size:10px; color:#ff0000; border:0; float:none; font-family: arial;}
</style>

 

 

<style type="text/css">
        .error{border:1px solid #ff0000;}
        label.error{display:block; width:200px; font-size:10px; color:#ff0000; border:0; float:none; font-family:  arial;}
</style>

 

 

Which is putting a nice red border around inputs with errors (as it should). But the error message itself is still displaying in Black, 12pt, Times New Roman.

Any ideas?

 

Any help would be greatly appreciated.

Best Answer chosen by Admin (Salesforce Developers) 
imuino2imuino2

It already should be in red and with border without doing anything. Make sure you didn't override the error message class from salesforce.

It is called errorMsg.

 

Ignacio.

All Answers

imuino2imuino2

It already should be in red and with border without doing anything. Make sure you didn't override the error message class from salesforce.

It is called errorMsg.

 

Ignacio.

This was selected as the best answer
tunedogtunedog

Thanks Ignacio. I actually have been using standardStyleSheets="false"... but using the css tag that you supplied (errorMsg) I recreated the error style and all is right with the world once more.

 

Thanks for your help.