正如问题中所解释的那样,我有一个愚蠢的小疑问..我准备了此代码..它无法识别银行帐号并继续说..不是帐号.!! 任何帮助......并且在比较我的其他程序中的字符串和数字时遇到了麻烦......顺便说一下我4天前开始学习J-script,所以请简单。:)
<html>
<head>
<title> New Document </title>
<meta name="Author" content="">
<!-- writw a program to check weather the bank account have a sufficient ballence or not -->
<script type="text/javascript" language="javascript">
function bankValidation()
{
var acc=document.myBank.accNum;
var acc_len=acc.value.length;
if(acc_len == 0)
alert("Account Number Field Is Empty!");
if(acc === 123456)
alert("Your Balance is 1000000");
else
alert("Not an account Number!");
}
</script>
</head>
<body>
<form name="myBank" onSubmit="bankValidation()" method="post">
<table class=table1 bgcolor=lightgrey>
<tr>
<td width=150>Bank Account No:</td>
<td><input name="accNum" type="text" id="accNum" value="12345" width="100"></input></td>
<tr>
<td colspan=2 align=middle></input>
<input type="submit" name="submit" value="check"></td>
</table>
</form>
</body>
</html>