177
Views
2
Comments
Solved
How do you change the style of invalid input border and validation message?

How do you change the style of invalid input border and the style of validation message?   


2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

You can change the Css two ways to achive this

1) by applying css on page level.  

span.validation-message {

    color: var(--color-error);    

font-size: var(--font-size-xs);   

 margin-left: var(--space-none);

}

.form-control.not-valid[data-input], .form-control.not-valid[data-textarea] {

    border: var(--border-size-s) solid var(--color-error);

2) Other way is 

If you want this globally in you application then you can change the :root color variable which is

--color-error


you can defiene custom colors here and it will work for your whole application. in which you have taken the theme dependency 

I hope this helps


Best Regards

Tousif Khan


2023-08-28 09-08-29
Venkatesh Sundarajan
Solution

Hi SH Kim,

Hope you are doing well!

You can inspect the screen by doing the "Ctrl+Shift+I". Then on clicking on the element you want to inspect  Eg: "Required field", you will find the class of it. You can try modify that class in your screen as per your need.

I have attached screenshot,


Thanks

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

You can change the Css two ways to achive this

1) by applying css on page level.  

span.validation-message {

    color: var(--color-error);    

font-size: var(--font-size-xs);   

 margin-left: var(--space-none);

}

.form-control.not-valid[data-input], .form-control.not-valid[data-textarea] {

    border: var(--border-size-s) solid var(--color-error);

2) Other way is 

If you want this globally in you application then you can change the :root color variable which is

--color-error


you can defiene custom colors here and it will work for your whole application. in which you have taken the theme dependency 

I hope this helps


Best Regards

Tousif Khan


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.