struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Wang" <ddw...@anomaly.net>
Subject validator question: show value of a field in error
Date Tue, 16 Sep 2003 21:12:40 GMT
I asked this earlier and did not receive any response, so i'll post it one
more time with more supporting info...

In validation.xml, how do I show the value of the offending field in the
error message as
opposed to the field name?

i.e. if the field I want to validate is email, and the user types in "foo",
how do I show
"'foo' is not a valid email address"

as opposed to the more standard (or widely documented) error
"'Email Address' is not valid"

In my current validation.xml, here's the relevant portion:
              <field property="email"
                     depends="required,email">
                  <msg
                    name="required"
                    key="errors.required"/>
                  <msg
                    name="email"
                    key="errors.bad.email"/>

                  <arg0 key="testForm.email"/>
              </field>


 Thanks,
Daniel


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


Mime
View raw message