1
我尝试使用ajax渲染窗体并以模态显示。 但是,当我在浏览器中检查源代码时,modal中的fom标签只出现在eachother旁边。我该如何解决这个问题?窗体在模态中无法正确显示
这里是我的语气写代码:
<!-- Modal Edit client -->
<div id="editClient" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Edit Client</h4>
</div>
<div class="modal-body">
<form id="editClientForm" action="{{ path('client_details') }}" method="POST">
{{ form_widget(form) }}
<br />
<input type="submit" class="btn btn-success" value="Save changes">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</form>
</div>
</div>
</div>
</div>
的模式与表单域打开和点击时取消被关闭。
这里是从浏览器的源代码:
<div class="modal-body">
<form id="editClientForm" action="/ruben/avr_symfony/web/app_dev.php/configurator/client/details" method="POST"></form>
=> here comes all the form fields and buttons.
</div>
正如你所看到的,它把表单字段前关闭窗体标签。