| Author |
how do u show multiple validation errors at once struts 1.2.4
|
john mattucci
Ranch Hand
Joined: Nov 03, 2000
Posts: 331
|
|
I have the following in validation.xml <field property="email" depends="required,email"> <arg0 key="registration.email"/> </field> the following in the ApplicationResources.properties errors.required={0} is required. errors.email={0} is an invalid e-mail address. registration.email= Email I was wondering how would I show both the required and the email at once rather than the required first and once that is corrected the email error is displayed thank you for your time
|
 |
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4134
|
|
You could define two separate validations instead of combining both in one. <field property="email" depends="required"> <arg0 key="registration.email"/> </field> <field property="email" depends="email"> <arg0 key="registration.email"/> </field> The question is, what's the point? It doesn't make much sense to me to show them both. If the user doesn't provide a required email address, then of course it is invalid. IMO, the errors messages should be mutually exclusive: if one is shown, the other one shouldn't.
|
Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
|
 |
 |
|
|
subject: how do u show multiple validation errors at once struts 1.2.4
|
|
|