You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <ma...@reumann.net> on 2002/09/05 23:22:25 UTC
Re[2]: concern over validation results
On Thursday, September 5, 2002, 5:11:40 PM, Devin wrote:
RDND> are you doing your validations in JavaScript (<html:javascript
RDND> formName=myForm />) or are you doing it on the server with Java
RDND> (myForm::validate())?
I'm using DynaValidatorForm and the validation that should take
place after I set up validation.xml and use the
validator-rules.xml. It only seems to return the "required"
errors first, then it will go through and check again upon the
next submit for any other errors. Maybe I have things set up
wrong, but that's how it's behaving for me. For example if I
have:
<field property="city" depends="required">
<arg0 key="city.displayname"/>
</field>
and also have:
<field property="stateExemptions" depends="integer">
<arg0 key="stateExemptions.displayname"/>
</field>
and I submit my form with the city field left blank and the
state exemptions field with "5yt6", it will return the error
about City is required (and not also the one about
stateExemptions being wrong). However, if I provide a city and a
messed up stateExemptions field then it returns fine with the
error about state Exemptions needs to be a number.
Any ideas what I have screwed up or is this how the server side
validation works?
thanks
--
Rick
mailto:maillist@reumann.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re[2]: concern over validation results
Posted by Rick Reumann <ma...@reumann.net>.
On Thursday, September 5, 2002, 5:32:15 PM, David wrote:
DG> I doubt that you've set things up wrong, because I've experienced the
DG> same problem, among others, using the validator. My feeling is that the
DG> validator's not quite ready for prime-time with Struts; I've gone back
DG> to implementing form beans by hand and coding validation in the bean's
DG> validate method. That works, and I have more control over the process.
That's a shame, because it's pretty cool stuff for sure. I love
being able to validate dates, and SSNs with a mask etc. I think
I'll stick to using it and deal with the apparent minor problem of
it not returning all the non-required validation back on the first
shot. (Hey, if the user can't follow directions and make sure to
fill out the fields with an asterisk, they deserve to maybe have
to submit the form twice:)
--
Rick
mailto:maillist@reumann.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: concern over validation results
Posted by David Geary <sa...@earthlink.net>.
Rick Reumann wrote:
>On Thursday, September 5, 2002, 5:11:40 PM, Devin wrote:
>
>RDND> are you doing your validations in JavaScript (<html:javascript
>RDND> formName=myForm />) or are you doing it on the server with Java
>RDND> (myForm::validate())?
>
> I'm using DynaValidatorForm and the validation that should take
> place after I set up validation.xml and use the
> validator-rules.xml. It only seems to return the "required"
> errors first, then it will go through and check again upon the
> next submit for any other errors. Maybe I have things set up
> wrong, but that's how it's behaving for me.
>
I doubt that you've set things up wrong, because I've experienced the
same problem, among others, using the validator. My feeling is that the
validator's not quite ready for prime-time with Struts; I've gone back
to implementing form beans by hand and coding validation in the bean's
validate method. That works, and I have more control over the process.
david
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>