You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by WiltOnTilt <aa...@hotmail.com> on 2007/08/10 22:41:10 UTC

Struts2 Validation formating error messages

Hi, I've searched around here and googling to try to find a good answer but I
haven't found one.

I'm using the basic struts2 validation with the validate="true" on my
<s:form> so the validation is done client side.

I'd like to change the error messages so they do not show up ABOVE my
controls.  (I dont know about you guys but wow that's so annoying... default
should have been right or left of the control)...

I'd like to get the error messages to show up to the right of my control and
I'd like those messages to be in red.  Alternatively, I wouldn't mind having
all the errors listed at the top of the page with red *'s next to each
field.  Either is fine.

Do I need to create my own version of <s:textfield> to make this happen?  Or
a new theme perhaps?  If so do you know of any good resources for this?

I've tried using the <s:actionerror /> tag but nothing ever renders from it?

Thanks!
Aaron
-- 
View this message in context: http://www.nabble.com/Struts2-Validation-formating-error-messages-tf4250977.html#a12098699
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 Validation formating error messages

Posted by Laurie Harper <la...@holoweb.net>.
WiltOnTilt wrote:
> Hi, I've searched around here and googling to try to find a good answer but I
> haven't found one.
> 
> I'm using the basic struts2 validation with the validate="true" on my
> <s:form> so the validation is done client side.
> 
> I'd like to change the error messages so they do not show up ABOVE my
> controls.  (I dont know about you guys but wow that's so annoying... default
> should have been right or left of the control)...
> 
> I'd like to get the error messages to show up to the right of my control and
> I'd like those messages to be in red.  Alternatively, I wouldn't mind having
> all the errors listed at the top of the page with red *'s next to each
> field.  Either is fine.
> 
> Do I need to create my own version of <s:textfield> to make this happen?  Or
> a new theme perhaps?  If so do you know of any good resources for this?
> 
> I've tried using the <s:actionerror /> tag but nothing ever renders from it?

Customizing whichever theme you are using is probably the easiest way to 
tailor the page layout as you wish. See here for relevant documentation:

http://struts.apache.org/2.x/docs/themes-and-templates.html
http://struts.apache.org/2.x/docs/extending-themes.html

HTH,

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org