concern over validation results
Sorry to repeat this question, possibly someone can help out... Is there any way I could use the validation package to not only just return errors where a required form field is missing but also on the FIRST return also bring back validation of form fields that are designated as 'not required' but do need validation if they are entered? For example picture a simple case where firstName and lastName are required fields and favoriteNumber is not required but has integer validation. Now it seems that if a user were to forget to enter a lastName and also entered in an invalid number, the only thing returned at first would be FirstName is required. It wouldn't be until they submitted again, after entering a firstName, that you would get the error returned about an invalid number entered for favorite number. Is there any way to have it also validate the favoriteNumber field (if one is entered) at the same time it is looking at the required fields? Thanks for any info. -- Rick mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: concern over validation results
are you doing your validations in JavaScript (html:javascript formName=myForm /) or are you doing it on the server with Java (myForm::validate())? I use both, and when I submit and process my validation, all errors are added to the request and are passed back to the JSP. -Devin -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 3:33 PM To: Struts List Subject: concern over validation results Sorry to repeat this question, possibly someone can help out... Is there any way I could use the validation package to not only just return errors where a required form field is missing but also on the FIRST return also bring back validation of form fields that are designated as 'not required' but do need validation if they are entered? For example picture a simple case where firstName and lastName are required fields and favoriteNumber is not required but has integer validation. Now it seems that if a user were to forget to enter a lastName and also entered in an invalid number, the only thing returned at first would be FirstName is required. It wouldn't be until they submitted again, after entering a firstName, that you would get the error returned about an invalid number entered for favorite number. Is there any way to have it also validate the favoriteNumber field (if one is entered) at the same time it is looking at the required fields? Thanks for any info. -- Rick mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
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:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: concern over validation results
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: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re[2]: concern over validation results
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:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]