一个输入框限定最多输入两位小数
$(".m_text").bind("input propertychange",function(){
var reg = new RegExp("^\\d+(\\.\\d{0,2})?$");
if(!reg.test($(this).val())){
alert("请您输入正确的金额(只包含两位小数)");
$(this).val("");
}
})
$(".m_text").bind("input propertychange",function(){
var reg = new RegExp("^\\d+(\\.\\d{0,2})?$");
if(!reg.test($(this).val())){
alert("请您输入正确的金额(只包含两位小数)");
$(this).val("");
}
})