Greetings,
I'm encountering something that is simply bizarre. I've got a Month dropdown whose option values are numbers like so:
<option value="07">July
<option value="08">August
<option value="09">September
<option value="10">October
etc.
I'm using some custom validation functions I found on the Netscape site, and found that August kept returning false in the isMonth() function. I isolated the problem statement in the function and found that the value for August bombs on a particular parseInt statement.
No other month does this.
When I do an alert on the value before the parseInt, it says "03" or "08" or whatever the value for the selected month is. After the parseInt, the other months say "3" or "7", but good ol August reports "0".
Example:
alert(themonth); //august says "08"
alert(parseInt(themonth)); //only august says "0", other months strip the 0
Hey, it's got to be something I'm doing or not doing but I sure can't see it. I made sure the length was 2 just in case an extra unseen space was creeping in there -- all months were length 2. If all the months acted the same I'd know it was a conversion error or something, but they look identical in the source code.
Any ideas? Thanks, Rick
I'm encountering something that is simply bizarre. I've got a Month dropdown whose option values are numbers like so:
<option value="07">July
<option value="08">August
<option value="09">September
<option value="10">October
etc.
I'm using some custom validation functions I found on the Netscape site, and found that August kept returning false in the isMonth() function. I isolated the problem statement in the function and found that the value for August bombs on a particular parseInt statement.
No other month does this.
When I do an alert on the value before the parseInt, it says "03" or "08" or whatever the value for the selected month is. After the parseInt, the other months say "3" or "7", but good ol August reports "0".
Example:
alert(themonth); //august says "08"
alert(parseInt(themonth)); //only august says "0", other months strip the 0
Hey, it's got to be something I'm doing or not doing but I sure can't see it. I made sure the length was 2 just in case an extra unseen space was creeping in there -- all months were length 2. If all the months acted the same I'd know it was a conversion error or something, but they look identical in the source code.
Any ideas? Thanks, Rick