Article ID: 191434 - View products that this article applies to.
This article was previously published under Q191434
This article has been archived. It is offered "as is" and will no longer be updated.
When a string value that contains leading zeros is passed to the parseInt() JScript function, parseInt will return 0 for "08" and "09".
You must remove the leading zeros before calling parseInt. Here is the code for the workaround:
Steps to Reproduce BehaviorThe following Web page demonstrates this problem. This Web page contains a text box. When focus is shifted away from the edit box by pressing the TAB key, the parseInt() function is called with the value that was entered into the text box. The value returned from parseInt() is then displayed in an alert box. If you enter "08" or "09" into the text box, parseInt() returns a value of 0.
The following JScript code demonstrates the workaround for this problem.