作者 anyv

4

... ... @@ -2,7 +2,7 @@
</head>
<body>
<div style="padding: 100px 100px 10px;">
<form class="bs-example bs-example-form" role="form" method="post" action="{:url('Ratio/ratio_list')}">
<form class="bs-example bs-example-form" role="form" method="post" action="{:url('Ratio/ratio_list')}" onsubmit="return checked()">
<div class="input-group" style="width: 100px;">
<span class="input-group-addon">平台订单</span>
</div>
... ... @@ -31,8 +31,23 @@
<input type="text" name="courier" class="form-control" value="{$data.courier}" >
</div>
<br>
<button type="submit" class="btn btn-default">确定</button>
<button type="submit" class="btn btn-default" >确定</button>
</form>
</div>
</body>
<script>
/**
* 当点击提交时
*/
function checked(){
salesman_ratio = $("input[name='salesman_ratio']").val();
teacher_ratio = $("input[name='teacher_ratio']").val();
$money = Number(salesman_ratio)+Number(teacher_ratio);
console.log($money);
if($money >= 1){
alert('业务员佣金比例和老师佣金比例之和不能大于1');
return false;
}
}
</script>
</html>
\ No newline at end of file
... ...