<input onkeyup="this.value=this.value.replace(/[^0-9-]+.[^0-9-]+/,'');" id="retailPrice"  type="text" class="layui-input"
name="commodityDetails.retailPrice" required
oninput="OnInputMath (event)" onpropertychange="OnPropChangedMath (event)" placeholder="请输入零售价" autocomplete="off"
class="layui-input">



function OnInputMath (event) {
layer.closeAll();
var reg=/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$/;
//正整数 reg = /^[1-9]+[0-9]*]*$/
if(event.target.value==""||reg.test(event.target.value)==true){

} else {
layer.msg("请输入数字 ");
}
}

相关文章:

  • 2021-11-27
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
猜你喜欢
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
相关资源
相似解决方案