文本框失去焦点 截掉小数点后3位数
<input class="s-sm" name="orderProducts[0].wide" type="text" onblur="if(!(/^\d+(\.\d{3})?$/.test(this.value))){this.value=this.value.substring(0,this.value.lastIndexOf('.')+4);}" />
function validateNum(value,num) {
if(!(/^\d+(\.\d{3})?$/.test(value)))
{
return value=value.substring(0,value.lastIndexOf('.')+num);
}else{
return value;
}
};