<form class="cell" lay-filter="myform2" enctype="multipart/form-data">
<p class="pp">add</p>
<div class="dss">
<div class="cell-mi">
<input type="text" name="inputa[]"><p class="del">del</p>
<div class="layui-form-item un_cloud">
<label class="layui-form-label" style="width: 100px">是否申请课酬</label>
<div class="layui-input-inline" style="width: 300px">
<input type="radio" name="is_fee[]" value="1" title="是">
<input type="radio" name="is_fee[]" value="2" title="否" checked>
</div>
</div>
</div>
</div>
<button class="layui-btn" lay-submit id="submit" lay-filter="go">提交</button>
<button class="tij" style="height: 100px">提交</button>
</form>
$(".pp").click(function () {
console.log(1111)
html = ' <div class="cell-mi"><input type="text" name="inputa[]"><p class="del">del</p>';
html += ' <div class="layui-form-item un_cloud">';
html += ' <label class="layui-form-label" style="width: 100px">是否申请课酬</label>';
html += ' <div class="layui-input-inline" style="width: 300px">';
html += ' <input type="radio" name="is_fee[]" value="1" title="是" >';
html += ' <input type="radio" name="is_fee[]" value="2" title="否" checked>';
html += ' </div>';
html += ' </div></div>';
$(".dss").append(html)
})
$('.dss').on('click', '.del', function(){
console.log('del')
(".cell-mi").eq((this).index()).remove();
})
$(".tij").click(function () {
console.log(2222)
var data = $('.cell').serializeArray();
$.ajax({
url: "{{url('/admin')}}",
type: "post",
dataType: "json",
data: data,
success: function (data) {
if (data.status == 1) {
layer.msg(data.msg, {
icon: 1,
time: 1000,
end: function () {
parent.location.reload(true);
parent.layer.closeAll();
}
});
} else {
layer.msg(data.msg, {icon: 2, time: 1000});
return false;
}
},
error: function () {
layer.msg('连接服务器失败!', {icon: 2, time: 1000});
return false;
}, complete: function () {
layer.close(loading_index);
}
});
前台打印看不出效果,后台打印可以看出效果