三级联动

 

 

layui模式的三级联动,二级只需要在复制一边 one 变two


        form.on('select(one)',function (data) {
            var id = data.value;
            $.ajax({
                url:"http://www.second.com/admmin/brand/next?id="+id,
                success:function (e) {
                    $("#three").empty()
                    $item ='<option value="">请选择</option>'
                    $(e.result).each(function (k,v) {
                        $item +=' <option value="'+v.id+'">'+v.cate_name+'</option>'
                    })
                    $('#two').html($item);
                    form.render();
                }
            })
        });
 <select name="one" lay-filter="one" lay-verify="required">
                <option value="">请选择</option>
                {foreach $cates as $v}
                <option value="{$v.id}">{$v.cate_name}</option>
                {/foreach}
            </select>
 
上一篇:Codeforces Round #673 (Div. 1)


下一篇:零基础入门学Python(七)—— 字典和集合