|
|
@@ -17,26 +17,6 @@ |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
<script> |
|
|
|
function checknum(obj) |
|
|
|
{ |
|
|
|
//如果输入非数字,则替换为'' |
|
|
|
obj.value = obj.value.replace(/[^\d\.]/g, ''); |
|
|
|
//必须保证第一个为数字而不是. |
|
|
|
obj.value = obj.value.replace(/^\./g,''); |
|
|
|
//前两位不能是0加数字 |
|
|
|
obj.value = obj.value.replace(/^0\d[0-9]*/g,''); |
|
|
|
//保证只有出现一个.而没有多个. |
|
|
|
obj.value = obj.value.replace(/\.{2,}/g,'.'); |
|
|
|
//保证.只出现一次,而不能出现两次以上 |
|
|
|
obj.value = obj.value.replace('.','$#$').replace(/\./g,'').replace('$#$','.'); |
|
|
|
//只能输入两位小数 |
|
|
|
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); |
|
|
|
} |
|
|
|
|
|
|
|
$('refund_fee').on('input',function () { |
|
|
|
checknum(this); |
|
|
|
}) |
|
|
|
|
|
|
|
function doRefund() { |
|
|
|
let id = document.getElementById("order_id").value; |
|
|
|
let refund_fee = document.getElementById("refund_fee").value; |
|
|
|