请教一个问题只限输入正整数js,并且首位不能为0,(06,6.1这些都不合法的)
这样写对不对.但是引用为什么不管用
function isNumber(s)
{
var regu = "^[0-9]+$";
var re = new RegExp(regu);
if (s.search(re) != -1)
{
return true;
}
else
{
return false;
}
}
引用:
<asp:TextBox ID="tbNeedNum" runat="server" BorderWidth="1px" Width="180px" onblur="isNumber(this.value);" ></asp:TextBox>
这样引用为什么不行.