I think I remember reading somewhere that the Validator plugin enforces these validations as a rule, which means the behavior should be consistent between their JS as well as Java validation codes. They do this to match what the Java compiler accepts, which IMO is strange since the validation should target the way the webapp is expected to be used, as opposed to the language used to write it. Anyway, this is why I ended up using mask validation instead, whenever I needed validation that should allow leading zeroes.
Hubert ps. IIRC, Validator accepts valid hex integers in the form of 0xCAFE, again same as the compiler. On Wed, 16 Feb 2005 13:14:35 -0600, snekse <[EMAIL PROTECTED]> wrote: > Has anyone else noticed the JavaScript function for Integer validation > does goofy things when you have a leading zero? > > Try passing these number into an Integer field: > > 045 > 075 > 078 > 085 > > The first 2 will pass, the second 2 will fail. After looking at the > source I found out that the JavaScript function assumes that a value > that has leading zeros is an octal number and will fail anything that > isn't 0-7. > > What I don't understand is why it does this. Why does the JS > validation differ from the Java validation? Once I commented out that > section of the JS code, it worked fine. Shouldn't they validate the > same? > > NOTE: There is also code looking for hex values if I recall correctly. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]