You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fea jabi <zy...@hotmail.com> on 2006/02/07 17:07:03 UTC

show single html:error message for multiple fields validation

I have a table. Have editors in it. and when the user doesn't enter I am 
displaying the editors with different border color. hence would like to 
display only one message of below above the table.

In message resources I have defined a key
lbl.errormsg=Enter all required fields.

validation.xml
            <field property="typeSelected" depends="required">
                <msg name="required" key="lbl.errormsg"/>
            </field>
            <field property="rate" depends="double,required">
                <msg name="required" key="lbl.errormsg"/>
                <msg name="double" key="lbl.errormsg"/>
            </field>


In jsp, I gave
<html:errors/>

Which is displaying all the errors. But would like to display only one 
defined earlier.
How to display only one message?

Thanks.

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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


RE: show single html:error message for multiple fields validation

Posted by fea jabi <zy...@hotmail.com>.
can someone help me with this please?  Thanks.


>From: "fea jabi" <zy...@hotmail.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: user@struts.apache.org
>Subject: show single html:error message for multiple fields validation
>Date: Tue, 07 Feb 2006 11:07:03 -0500
>
>I have a table. Have editors in it. and when the user doesn't enter I am 
>displaying the editors with different border color. hence would like to 
>display only one message of below above the table.
>
>In message resources I have defined a key
>lbl.errormsg=Enter all required fields.
>
>validation.xml
>            <field property="typeSelected" depends="required">
>                <msg name="required" key="lbl.errormsg"/>
>            </field>
>            <field property="rate" depends="double,required">
>                <msg name="required" key="lbl.errormsg"/>
>                <msg name="double" key="lbl.errormsg"/>
>            </field>
>
>
>In jsp, I gave
><html:errors/>
>
>Which is displaying all the errors. But would like to display only one 
>defined earlier.
>How to display only one message?
>
>Thanks.
>
>_________________________________________________________________
>Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
>Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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