You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sony Thomas <so...@genialgenetics.com> on 2005/12/15 09:57:22 UTC

How can I attach error messages with the field

HI,

Is there is any way to attach error messages with the specific field. I 
mean I have an error messsage "Username required" How can I print that 
message just down the label of username.

thanks sony

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


Re: How can I attach error messages with the field

Posted by Laurie Harper <la...@holoweb.net>.
Sony Thomas wrote:
> Is there is any way to attach error messages with the specific field. I 
> mean I have an error messsage "Username required" How can I print that 
> message just down the label of username.

Use <html:messages property="user">...</...> to access messages specific 
to the field 'user'. For example:

   User Name: <html:input property="user"/>
              <html:messages property="user" id="msg">
                <c:out value="${msg}"/>
              </html:messages>

L.


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