Home Article 添加一行 ,删除一行

添加一行 ,删除一行

Source:添加一行 ,删除一行 Release time:2019-12-31 Author:Mr.赵 Reading volume:12
<form class="layui-form" id="admin">
<div id="content">
<div class="layui-form-item">
<label class="layui-form-label">ChangeCourse</label>

<div style="width: 100%">
<div class="layui-input-block" style="max-width:120px;float:left;">
<select name="courseid[]" lay-filter="aihao">
<option value="">Please select a area</option>
{volist name="university_course_cate" id="vo"}
<option value="{$vo.id}" >{$vo.name}</option>
{/volist}
</select>
</div>
<div class="layui-input-block" style="max-width:120px;float:left;">
<input name="entry_criteria[]" lay-verify="name" autocomplete="off" placeholder="entry_criteria" class="layui-input" type="text" >
</div>
<div class="layui-input-block" style="max-width:120px;float:left;">
<input name="student_satisfaction[]" lay-verify="name" autocomplete="off" placeholder="student_satisfaction" class="layui-input" type="text" >
</div>
<div class="layui-input-block" style="max-width:120px;float:left;">
<input name="research_quality[]" lay-verify="name" autocomplete="off" placeholder="research_quality" class="layui-input" type="text" >
</div>
<div class="layui-input-block" style="max-width:120px;float:left;">
<input name="prospects_for_graduates[]" lay-verify="name" autocomplete="off" placeholder="prospects_for_graduates" class="layui-input" type="text" >
</div>
<div class="layui-input-block" style="max-width:120px;float:left;">
<input name="total_score[]" lay-verify="name" autocomplete="off" placeholder="total_score" class="layui-input" type="text" >
</div>
<div class="layui-input-block" style="max-width:120px;float:left;">
<button calss="btn add-column" onclick="addthis(this)" type="button">Add this</button>
</div>
<div class="layui-input-block" style="max-width:120px;float:left;">
<button onclick="delthis(this)">delete this</button>
</div>

</div>
</div>

</div>

<script>


var addthis = function(e){
var $html = '<div class="layui-form-item">';
$html += $(e).parent().parent().parent().html();
$html+= "</div>";

$("#content").append($html);
layui.use(['form'],function(){ //layui刷新
var form = layui.form;
form.render();
})
}

function delthis(obj) {
$(obj).parent().parent().parent().remove();
}
</script>

<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="admin">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>

</form>
  
I want to comment
Leave a message
http://boke.zhaozhiqi.top/index.php/
User login
You have not written any reviews yet!
You have commented!
Can only praise once!
You have a collection!