You can check if there is an errors object in scope
using the logic tags to change the color of a label.
<logic:present name="<%=
org.apache.struts.action.Action.ERROR_KEY %>"
scope="request">
red label1
</logic:present>
<logic:notPresent name="<%=
org.apache.struts.action.Action.ERROR_KEY %>"
scope="request">
blue lable2
</logic:notPresent>
If you want to display the error message next to a
field, you can do this. This will display all error
messages that have been set for the 'name' property.
<html:errors property="name"/>
David
--- Matthias Brahm <[EMAIL PROTECTED]> wrote:
> Hi,
>
> is it possible to do something like this with
> struts:
>
> I have a form with labels for the input fields.
> These labels have the font color blue.
>
> The Form is validated by the FormBean.
> When one or more fields of the form are invalid
> and the control is forwarded back to the input form,
> the labels of the invalid input fields should have
> the font color red.
>
> In general, is it possible to output one text and in
> case of an error
> another one?
>
> Can I do this with the struts-tag-libs
> (html:errors)?
>
> Thanls
>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/