// 注:需要写在layui的初始化里
form.render();
// html lay-filter是必须的
<select id="sel_column_parent" lay-filter="sel_column_parent"></select>
// js部分 需要写在layui初始化里,也就是layui.use里
form.on('select(sel_column_parent)', function(data) {
console.log(data.value)
});
注意:所有表单类样式,都需要在最顶级标签,添加样式class="layui-form"
<div class="layui-form-item">
<label class="layui-form-label">复选框</label>
<div class="layui-input-block">
<input type="checkbox" name="arr[]" title="选项1">
<input type="checkbox" name="arr[]" title="选项2" checked>
<input type="checkbox" name="arr[]" title="选项3">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">单行选择框</label>
<div class="layui-input-block">
<select name="interest" lay-filter="aihao">
<option value=""></option>
<option value="0">写作</option>
<option value="1" selected>阅读</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">单选框</label>
<div class="layui-input-block">
<input type="radio" name="sex" value="男" title="男" checked>
<input type="radio" name="sex" value="女" title="女">
<input type="radio" name="sex" value="禁" title="禁用" disabled>
</div>
</div>