如何在html.TextBoxFor中使用数字格式
我想使用数字格式1.01、02.01或02.1,意思是(x.xx)、(xx.xx)或(xx.x),数字是有限的(0到9)
发布于 2015-02-05 21:22:45
尝试添加数字类型和步长属性,
@html.TextBoxFor(...., new {type="number", step="0.01"})发布于 2019-12-15 16:44:12
你可以试试这个。还要将最小和最大属性设置为html文本框的0和9。
var Validation = function (v) {
var regex = /^[0-9]*\.?[0-9]*$/;
return v.match(regex);
}https://stackoverflow.com/questions/28344760
复制相似问题