簡體   English   中英

如何從javascript中的表單數據中刪除選定的輸入對象?

[英]How to remove selected input object from form data in javascript?

我有 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 中刪除

在刪除功能中,您將獲得 1,stray 和 id 將分別創建在 javascript 中的創建 id 並刪除

var no = 1;
var stmt = stray;

$("#preview_preson"+_no_stmt).remove()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM