This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I'm using struts 1.1b3 release. When I am doing validation, I set up 2 fields in my validation.xml file. I have both fields as required. Field 1 has to also validate a minlength and Field 2 has to validate against a range. The following will illustrate the issue I'm having. Situation #1 Field 1: (leave blank) Field 2: (leave blank) Error Messages: Field 1 is required Field 2 is required Situation #2 Field 1: hello (this should fail validation) Field 2: (leave blank) Error Messages: Field 2 is required In situation #2, I would also expect an error message from Field 1 stating that it does not meet the minlength rule. Instead, it looks like the validator is making the user enter in all of the required fields before going forward with any validation. I was wondering if anyone else had noticed this behavior?? Thanks
I'm no validator guru on struts other than playing with it a bit. However, if memory serves me right, if you look at the javascript generated for the button, you'll see that it sequentially calls each generated javascript function. If the called function says it failed validation, then it stops. Long story short. It will only emit errors for one "kind of" validation and those must be fixed before it will even attempt to validate other aspects of the properties on the page.