$("#bankAccountNumber")change(function(){
alert("");
var account = $("channelFormbankAccountaccount")val();
alert("");
var reg = /^d{}$/g; // 以位数字开头以位数字结尾
if( !regtest(account) )
{
alert("格式错误应该是位数字!");
}
})
<!DOCTYPE html PUBLIC "//WC//DTD XHTML Transitional//EN" "
<html xmlns="
<head>
<meta httpequiv="ContentType" content="text/html; charset=gb" />
<title>验证银行账号</title>
<style type="text/css">
<!
STYLE {color: #FF}
>
</style>
<script language="javascript" type="text/javascript">
function check()
{
var account = documentformaccountvalue;
var reg = /^d{}$/g; // 以位数字开头以位数字结尾
if( !regtest(account) )
{
alert("格式错误应该是位数字!");
}
else
{
alert("验证成功!");
}
}
</script>
</head>
<body>
<form id="form" name="form" method="post" action="">
<p>账号
<input type="text" name="account" id="account" />
<span class="STYLE">* (位数字)</span></p>
<p>
<input type="button" name="button" id="button" value="验证" onclick="check()" />
</p>
</form>
</body>
</html>