K
kaeli
Can anyone explain to me why
01/10/2003 is a number according to isNaN/parseFloat?
Example code:
<html>
<head>
<title> New Document </title>
</head>
<body>
<script>
function isNumber(str)
{
if (isNaN(parseFloat(str))) alert("not a number");
else alert("number");
}
</script>
<form name="f1" onSubmit="return false">
Text: <input type="text" name="t1"><br>
<input type="button" onClick="isNumber(this.form.t1.value)" value="is
number?">
</body>
</html>
--
01/10/2003 is a number according to isNaN/parseFloat?
Example code:
<html>
<head>
<title> New Document </title>
</head>
<body>
<script>
function isNumber(str)
{
if (isNaN(parseFloat(str))) alert("not a number");
else alert("number");
}
</script>
<form name="f1" onSubmit="return false">
Text: <input type="text" name="t1"><br>
<input type="button" onClick="isNumber(this.form.t1.value)" value="is
number?">
</body>
</html>
--