标签:ice red price text orm control UI for required
1.限制input只能输入数字
<input id="Number" name="Number" type="text" class="form-control required" onkeyup="value=this.value.replace(/\D+/g,‘‘)" placeholder="请输入数量" />
2.限制input只能输入数字和小数点(用于金额输入框等)
<input id="Price" name="Price" type="text" class="form-control" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,‘‘)" placeholder="请输入单价" />
标签:ice red price text orm control UI for required
原文地址:http://www.cnblogs.com/chen-yuan/p/7285890.html