欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

layui復(fù)選框限制選擇個(gè)數(shù)的方法

 更新時(shí)間:2019年09月18日 15:01:43   作者:aawuwuwuxx  
今天小編就為大家分享一篇layui復(fù)選框限制選擇個(gè)數(shù)的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧

復(fù)選框限制選擇個(gè)數(shù)的方法

html

<div class="layui-form-item">
  <label class="layui-form-label">xxx</label>
  <div class="layui-input-block">
    <input class="education" lay-filter="hope" type="checkbox" name="param[hope_employ][]" value="yy" title="xx">
  </div>
</div>

js

form.on('checkbox(hope)',function(data){
  console.debug(data);
  var len=$(".education:checked").length;
  if(len>3){
    $(data.elem).next().attr("class","layui-unselect layui-form-checkbox");
    $(data.elem).prop("checked",false);
    layer.msg('最多只能選3項(xiàng)!',{icon:5});
    return false;
  }
});

以上這篇layui復(fù)選框限制選擇個(gè)數(shù)的方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論