I am trying to change the color of error message. I am using a Stripes validation.If the validation failed, I am sending a error message. I wanted it in red color.But it shows in black color. How can i change the color of error message in Stripes framework.
Following is what i have tried.
<div class="item">
<stripes:errors />
<stripes:form name="home"action="/home.action">
//contents
</stripes:form>
</div>
As Vinoth says you can apply CSS classes to change the appearance of error messages. In addition to that, Stripes messages can be fully customized by editing StripesResources.properties
.
Here you can define exactly what your messages will look like, using markup and CSS classes, or even inline styles.
# Resource strings used by the <stripes:errors> tag when there are no nested tags
stripes.errors.header=<div class="my-error-wrapper"><h4>Ooops... some things went awfully awry:/h4><ol>
stripes.errors.beforeError=<li><i class="fa fa-warning"></i>
stripes.errors.afterError=</li>
stripes.errors.footer=</ol></div>
# Resource strings used by the <stripes:errors> tag when displaying errors for a
# specific field (e.g. <stripes:errors field="password"/>). If not supplied the
# values above will be used instead.
stripes.fieldErrors.header=
stripes.fieldErrors.beforeError=<span class="my-error-inline"><i class="fa fa-warning"></i>
stripes.fieldErrors.afterError=</span>
stripes.fieldErrors.footer=
# Resource strings used by the stripes:messages tag
stripes.messages.header=<div class="my-message-wrapper"><ul>
stripes.messages.beforeMessage=<li>
stripes.messages.afterMessage=</li>
stripes.messages.footer=</ul></div>
As you can see you can add extra fancy stuff like FontAwesome icons (admitted, this goes a little further than OP asks for).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With