如何使用复选框删除多个图像。这里我提到了HTML,屏幕(输出)。
1)在此代码中,单击全选后,我保留了Checkbox,它会选择所有图像,但是我不知道如何传递ID来删除所有图像。
HTML
<div class="panel panel-default">
<div class="pull-right"></div>
<div class="Heading panel-heading">
<h3 class="panel-title">Gallery Images List</h3>
</div>
<h4>Select All
<input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></h4>
<button class="btn btn-danger">Delete</button>
<div class="panel-body" style="padding-left: 50px; padding-right: 50px; padding-top:10px;">
<div class="table-responsive">
{% for i in details %}
<b style="font-size:16px;">{{i.placename}}</b>
<div class="row">
{% for j in img %}
<div class="col">
{% if i.placename == j.gallery_place %}
<div class="show-image">
<img src="{{j.gallery_image.url}}" style="height:130px; width:130px;" />
<a href="/GalleryImagesDelete/{{j.id}}">
<span class="delete glyphicon glyphicon-remove"></span>
</a>
<br/>
<tag class="one" style="margin:8%">
<input type="checkbox" name="selected[]" value="33" />
</tag>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
</div>
图片