点击按钮动态添加 <input type="file">

点击按钮动态添加 <input type="file">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<tr> <th contenteditable="true" ><input type="text" oninput="filterTable(1)" placeholder="aoiStep" ></th> <th contenteditable="true" ><input type="text" oninput="filterTable(2)" placeholder="defectType" ></th> <th contenteditable="true" ><input type="text" oninput="filterTable(3)" placeholder="layerCode" ></th> <th contenteditable="true" ><input type="text" oninput="filterTable(4)" placeholder="type"></th> <th contenteditable="true" ><input type="text" oninput="filterTable(5)" placeholder="dpet" ></th> <th contenteditable="true"><input type="text" oninput="filterTable(6)" placeholder="subcode" ></th> <th contenteditable="true" ><input type="text" placeholder="codeDescription" ></th> <th contenteditable="true" >image1</th> <th contenteditable="true" >image2</th> <th contenteditable="true">image3</th> <th contenteditable="true" >image4</th> <th contenteditable="true" >image5</th> <th contenteditable="true" ><input type="text" placeholder="determination_rule"></th> </tr> </thead> <tbody> <form action="upload.php" method="POST" enctype="multipart/form-data"> <tr> <td input type="text" name="aoi_step">3</td> <td input type="text" name="defect_type">Particle</td> <td input type="text" name="layer_code">ACT</td> <td input type="text" name="type">Particle</td> <td input type="text" name="dpet">ACT</td> <td input type="text" name="subcode">Particle</td> <td input type="text" name="code_description">ACT</td> <td> <input type="file" name="image1_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> <td> <input type="file" name="image2_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td> <input type="file" name="image3_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td> <input type="file" name="image4_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td> <input type="file" name="image5_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td input type="text" name="determination_rule">Particle</td> <table id="data_table"> <thead> </form> </tbody> </table> 我只需要上传表格内容,不需要上传表头内容,应该怎么处理
最新发布
07-23
如果你只需要上传表格的内容而不需要上传表头内容,你可以将表头的部分独立出来,只在表格内容部分放置 `<form>` 元素来处理数据上传。 下面是修改后的代码示例: ```html <!-- 表头部分 --> <thead> <tr> <th>aoiStep</th> <th>defectType</th> <th>layerCode</th> <th>type</th> <th>dpet</th> <th>subcode</th> <th>codeDescription</th> <th>image1</th> <th>image2</th> <th>image3</th> <th>image4</th> <th>image5</th> <th>determination_rule</th> </tr> </thead> <!-- 表格内容部分 --> <tbody> <form action="upload.php" method="POST" enctype="multipart/form-data"> <tr> <td><input type="text" name="aoi_step"></td> <td><input type="text" name="defect_type"></td> <td><input type="text" name="layer_code"></td> <td><input type="text" name="type"></td> <td><input type="text" name="dpet"></td> <td><input type="text" name="subcode"></td> <td><input type="text" name="code_description"></td> <td><input type="file" name="image1_path"></td> <td><input type="file" name="image2_path"></td> <td><input type="file" name="image3_path"></td> <td><input type="file" name="image4_path"></td> <td><input type="file" name="image5_path"></td> <td><input type="text" name="determination_rule"></td> </tr> <!-- 这里可以继续添加更多行 --> <!-- 提交按钮 --> <tr> <td colspan="13"> <input type="submit" value="提交"> </td> </tr> </form> </tbody> ``` 这样,只有表格的内容部分被包裹在 `<form>` 元素中,表头部分不会被上传到服务器。 希望这个示例对你有帮助!如果还有其他问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值