我遇到的情况是我只在表单发布后获取值。我需要在HTML模型上显示这些值。但是当表单发布时,页面会刷新,模型会消失。
有没有办法在表单发布后显示html模型?
<div id="uploadCSV" class="tab-pane fade">
<form class="form form-vertical" action="{% url 'add_stores_bulk' %}" method="post"
enctype="multipart/form-data" id="frm">
{% csrf_token %}
<fieldset>
<!-- Button (Double) -->
<div class="form-group">
<label class="col-md-4 control-label" for="button1id"></label>
<div class="col-md-8">
<button id="button1id" name="button1id" class="btn btn-danger">Cancel</button>
<button type="submit" id="uploadStoreCSVBtn" name="uploadStoreCSVBtn"
class="btn btn-primary" data-toggle="modal" data-target="#addBulkStoreMsgModal">
Upload
</button>
<div id="addBulkStoreMsgModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title text-danger">Alert!</h4>
</div>
<div class="modal-body" id="addBulkStoreMsgModalBody">
{{ response }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</form>
</div>
&#13;