Re: JavaScript Integer Validation - Leading zeros

2005-02-17 Thread snekse
> Although JavaScript is not Java, the language designers adopted the > same syntax for integer literals that is found in Java (and C/C++/C#) > ... integer literals with a leading 0 are interpreted to be octal > literals, unless they start with 0x or 0X to indicate hexadecimal > literals. > > Crai

Re: JavaScript Integer Validation - Leading zeros

2005-02-16 Thread Craig McClanahan
On Wed, 16 Feb 2005 14:19:15 -0500, Slattery, Tim - BLS <[EMAIL PROTECTED]> wrote: > > What I don't understand is why it does this. Why does the JS > > validation differ from the Java validation? > > JavaScript is NOT Java!! They have confusingly similar names, but they are > totally different. T

Re: JavaScript Integer Validation - Leading zeros

2005-02-16 Thread Hubert Rabago
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 shoul

RE: JavaScript Integer Validation - Leading zeros

2005-02-16 Thread Slattery, Tim - BLS
> What I don't understand is why it does this. Why does the JS > validation differ from the Java validation? JavaScript is NOT Java!! They have confusingly similar names, but they are totally different. There's no reason to expect that the performance of one should be similar to the performanc

JavaScript Integer Validation - Leading zeros

2005-02-16 Thread snekse
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 funct