前端:html、js、jquery,后端:php、thinkPHP
在前端网页中动态添加输入框,后端整理数据
1、前端HTML部分:
<table class="layui-table">
<thead>
<tr>
<th>项目</th>
<th>名称</th>
<th>
<button type="button" class="layui-btn layui-btn-xs layui-btn-primary" style="margin-right: 0;font-size:12px;" id="add_jscs_tr">添加</button>
</th>
</tr>
</thead>
<tbody id="jishucanshu_inputs">
{notempty name="$data.jishucanshu"}
{volist name="$data.jishucanshu" id='jscs1'}
<tr class="del operate">
<td><input type="text" name="jscs_one[]" {notempty name="$jscs1[0]"}value="{$jscs1[0]}"{/notempty}></td>
<td><textarea id="symptomTxt" oninput="autoTextAreaHeight(this)" name="jscs_two[]

本文介绍如何在Think PHP的模板文件中结合jQuery动态创建文本输入框,并在后端使用PHP进行数据处理。前端通过HTML和jQuery实现动态添加,后端利用Think PHP框架进行数据整合。
最低0.47元/天 解锁文章
263

被折叠的 条评论
为什么被折叠?



