1.js 中 关于金额 的正则表达式
οnkeyup="judgeNum(this)"
function judgeNum(o){
var value = o.value;
var patrn=/^\d{0,8}(\.\d{0,4})?$/;
if(!patrn.test(value)){
o.value = "";
}
}
1.js 中 关于金额 的正则表达式
οnkeyup="judgeNum(this)"
function judgeNum(o){
var value = o.value;
var patrn=/^\d{0,8}(\.\d{0,4})?$/;
if(!patrn.test(value)){
o.value = "";
}
}
转载于:https://www.cnblogs.com/southbean/articles/10042396.html