如何提交多个具有相同name属性的表单

<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);

}

});

前台打印看不出效果,后台打印可以看出效果

相关推荐
朱剑君3 小时前
第四天——贪心算法——种花
算法·贪心算法
TextIn智能文档云平台3 小时前
PDF文档解析新突破:图表识别、公式还原、手写字体处理,让AI真正读懂复杂文档!
图像处理·人工智能·算法·自然语言处理·pdf·ocr
Panesle3 小时前
HunyuanCustom:文生视频框架论文速读
人工智能·算法·音视频·文生视频
hie988943 小时前
matlab稳定求解高精度二维对流扩散方程
算法·机器学习·matlab
买了一束花4 小时前
MATLAB导出和导入Excel文件表格数据并处理
人工智能·算法·matlab
纪元A梦4 小时前
贪心算法应用:顶点覆盖问题详解
java·算法·贪心算法
咩咩觉主4 小时前
c#数据结构 线性表篇 非常用线性集合总结
开发语言·数据结构·unity·c#·游戏引擎·程序框架
爱补鱼的猫猫5 小时前
22、近端策略优化算法(PPO)论文笔记
论文阅读·算法
开心星人5 小时前
【论文阅读】Reconstructive Neuron Pruning for Backdoor Defense
论文阅读·算法·剪枝
zhangpeng4555479406 小时前
数据结构-非线性结构-二叉树
数据结构