Browse Source

修复商品表单物流信息模块js表单验证

antshop
linyaostalker 5 years ago
parent
commit
bfebc37a95
  1. 8
      backend/modules/goods/views/goods/express.php

8
backend/modules/goods/views/goods/express.php

@ -28,6 +28,10 @@ use backend\modules\shop\models\ars\ExpressTemplate;
<?php <?php
$js =<<<JS $js =<<<JS
$(document).ready(function(){
if(!$("#goods-uniform_postage").val()){
$("#goods-uniform_postage").val("0.00")
}
$("input:radio[name='Goods[is_express]']").on('ifChecked', function(event){ $("input:radio[name='Goods[is_express]']").on('ifChecked', function(event){
if ($(this).val() === '1') { if ($(this).val() === '1') {
$("#isExpress").show(); $("#isExpress").show();
@ -45,6 +49,9 @@ use backend\modules\shop\models\ars\ExpressTemplate;
} }
}) })
$("#goods-uniform_postage").blur(function(){ $("#goods-uniform_postage").blur(function(){
if(!$(this).val()){
$(this).val("0.00")
}
if(isNaN($(this).val())){ if(isNaN($(this).val())){
$(this).val("0.00") $(this).val("0.00")
} }
@ -74,6 +81,7 @@ use backend\modules\shop\models\ars\ExpressTemplate;
} }
return f; return f;
} }
})
JS; JS;
$this->registerJs($js); $this->registerJs($js);
Loading…
Cancel
Save