ayuLiao
5/5/2018 - 4:31 AM

redio控制界面

通过radio控制input是否显示

<!-判断redio按钮的value,控制显示相应的内容-->

<!--控制按钮-->
<div class="col-sm-6">
    <input type="radio" name="broad_type" checked value='0' class="broad_type" />&nbsp;定额红包&nbsp;&nbsp;
    <input type="radio" name="broad_type" value='1' class="broad_type" />&nbsp;随机红包&nbsp;&nbsp;
</div>

              <div class="form-group fix_money">
                 <label class="col-sm-3 control-label">定额红包金额</label>
                 <div class="col-sm-6">
               <input style="width:100%;float:left;" class="form-control" type="text" name="fix_money" id="fix_money">
                  <label for='fix_money' class='hitLabel'>*</label>
                  </div>
              </div>

              <div class="form-group pronmoney"  style='display:none;'>
                 <label class="col-sm-3 control-label">随机红包上限</label>
                 <div class="col-sm-6">
               <input style="width:100%;float:left;" class="form-control" type="text" name="upmoney" id="upmoney">
                  <label for='upmoney' class='hitLabel'>*</label>
                  </div>
              </div>


              <div class="form-group pronmoney" style='display:none;'>
               <label class="col-sm-3 control-label">随机红包下限</label>
               <div class="col-sm-6">
                <input style="width:100%;float:left;" class="form-control" type="text" name="downmoney" id="downmoney">
                  <label for='downmoney' class='hitLabel'>*</label>
                  </div>
              </div>
              
<script type="text/javascript">

    $('.broad_type').click(function(){
        var choosVal = $(this).val()
        if (choosVal == '0'){
            $('.pronmoney').css({'display':'none'});
            $('.fix_money').css({'display':'block'});
         }else{
            $('.pronmoney').css({'display':'block'});
            $('.fix_money').css({'display':'none'});
        }

    });
</script>