Jen Song
08-11-2003, 09:51 AM
Hi,
I have the following JSP page with a very simple Javascript function to display number 1 to 10. It display 1 to 7 and 10 correctly, but for "08" and "09", it displays 0. Why doesn't the parstInt funciton like 08 and 09?
<html>
<head>
<SCRIPT TYPE="text/javascript">
<!--
function validateInput () {
alert(parseInt("01"));
alert(parseInt("02"));
alert(parseInt("03"));
alert(parseInt("04"));
alert(parseInt("05"));
alert(parseInt("06"));
alert(parseInt("07"));
alert(parseInt("08"));
alert(parseInt("09"));
alert(parseInt("10"));
return true;
}
//-->
</SCRIPT>
</head>
<body>
<form action="button.jsp">
<button onClick="return validateInput()"> Test!
</button>
</form>
</body>
</html>
I have the following JSP page with a very simple Javascript function to display number 1 to 10. It display 1 to 7 and 10 correctly, but for "08" and "09", it displays 0. Why doesn't the parstInt funciton like 08 and 09?
<html>
<head>
<SCRIPT TYPE="text/javascript">
<!--
function validateInput () {
alert(parseInt("01"));
alert(parseInt("02"));
alert(parseInt("03"));
alert(parseInt("04"));
alert(parseInt("05"));
alert(parseInt("06"));
alert(parseInt("07"));
alert(parseInt("08"));
alert(parseInt("09"));
alert(parseInt("10"));
return true;
}
//-->
</SCRIPT>
</head>
<body>
<form action="button.jsp">
<button onClick="return validateInput()"> Test!
</button>
</form>
</body>
</html>