产品要求价格输入框要分别提示整数部分不超过6位 如果有小数提示小数部分不超过两位 为0提示不能为0.
原先的代码如下
if(/^([1-9]\d{0,5})$|^\d{1,6}\.[0-9]{1,2}$/.test(str)){
layer.close(index);
$('input[name="price[]"]').val(str).parent().removeClass('has-error');
setmin();
getid();
}else{
error_Toast('价格整数部分不能超过六位,小数部分不能超过两位,且不可为0');
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
光阴似箭催人老,日月如移越少年。