|
|
@@ -0,0 +1,36 @@ |
|
|
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="control-label col-xs-12 col-sm-2">订单ID</label> |
|
|
|
<div class="col-xs-12 col-sm-8"> |
|
|
|
<input id="order_id" class="form-control" readonly="readonly" name="id" type="number" value="{$id}"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="control-label col-xs-12 col-sm-2">退款金额</label> |
|
|
|
<div class="col-xs-12 col-sm-8"> |
|
|
|
<input id="refund_fee" class="form-control" name="id" type="number" value="{$id}"> |
|
|
|
</div> |
|
|
|
</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); |
|
|
|
}) |
|
|
|
</script> |