我有如下 HTML 文件:
<form method="POST" enctype="multipart/form-data" class="icons-tab-steps wizard-circle" action="{{url('/shelter/intake')}}">
<input type="file" name="data[person][person_identification1]"
id="preview_preson_1_stray">
<a href="#" onclick="deleteSelection('1','stray')">
<span class="delete"><i class="fa fa-trash" aria-hidden="true"></i>
</span>
</a>
</form>
当我点击删除时,对象应该从 data[person][person_identification1] 中删除。这个怎么做?请为此提供帮助。
最佳答案
从 UI 中移除
在 Delete 函数中你会得到 1,stray & id 将在 javascript 中单独创建 create id & remove
var no = 1;
var stmt = stray;
$("#preview_preson"+_no_stmt).remove()
关于javascript - 如何从 javascript 中的表单数据中删除选定的输入对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52621061/