layui 单选框选中事件
<div class="layui-form-item" pane="">
<label class="layui-form-label">节点</label>
<div class="layui-input-block">
<input type="radio" name="sex" value="左节点" title="左节点" lay-filter="jiedian" >
<input type="hidden" name="leftjiedian" id="zjidian">
<input type="radio" name="sex" value="右节点" title="右节点" lay-filter="jiedian">
<input type="hidden" name="rightjiedian" id="rjidian">
</div>
</div>
form.on('radio(jiedian)', function (data) {
//alert(data.elem);
//console.log(data.elem);
alert(data.value);//判断单选框的选中值
var abc=data.value;
if(abc=="左节点"){
$("#zjidian").val("1");
$("#rjidian").val("");
// alert($("#zjidian").val());
}else{
$("#rjidian").val("1");
$("#zjidian").val("");
// alert($("#rjidian").val());
}
//console.log(data.value);
//alert(data.othis);
//layer.tips('开关checked:' + (this.checked ? 'true' : 'false'), data.othis);
//layer.alert('响应点击事件');
});
posted on 2018-05-01 22:15 superficial。 阅读(11412) 评论(0) 编辑 收藏 举报