日期:2014-05-16 浏览次数:20511 次
<td class="t_10">拨打次数:</td> <td class="t_23"> <input id="dialCount" name="dialCount" style="width:80%" value="" onblur="validate()"> </td>
isNaN($("#dialCount").attr("value"))
var dialCount = $("#dialCount").attr("value").replace(/(^\s*)|(\s*$)/g, ""); //去空格 var reg = /^[0-9]+$/;//可以输入多位,如果只让输入一位数字用var reg = /^[0-9]$/ if(dialCount!=""&&(!reg.exec(dialCount))){ alert("拨打次数是非负整数"); return; }
<td class="t_10">拨打次数:</td> <td class="t_23"> <input id="dialCount" name="dialCount" style="width:80%" value="" onblur="validate()"> </td>