形式动作laravel 5.1中的对话框形式

时间:2016-01-26 06:57:21

标签: php laravel-5

我有以下表单操作:

<form  id="form_1" action="{{route("admin.pos.store")}}" method="POST" enctype="multipart/form-data" onsubmit="return CJForm_s(1)">
<!-- Transaction form -->

<!-- end Transaction -->
<!-- Dialog Payment -->
<button  class="btn btn-info btn-block btn-lg" type="button" data-toggle = "modal" data-target="#payments" >Complete</button>
<div class="modal fade" id="payments" tabindex="-1" role="dialog" aria-labelledby="payments">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="method">Method Payment</h4>
            </div>
            <div class="modal-body">
                <button class="btn btn-primary" type="button" id="debit">Debit</button>
                <button class="btn btn-primary" type="button" id="kredit">Kredit</button>
                <button class="btn btn-primary" type="button" id="transfer">Transfer</button>
                <button class="btn btn-primary" type="button" id="cash">Cash</button>
                <hr/>
                <div id="content-payment"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary" type="submit">Send</button>
            </div>
        </div>
    </div>
</div>
<!-- End Dialog Payment -->
</form>

如果我点击对话框中的提交按钮,它将存储所有交易并在对话框中输入。如果在对话框中提交没有任何反应,就会发生这种情况

你能为我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

你有type属性2次。删除发送按钮中的type="button"

<button class="btn btn-primary" type="submit" id="send_payment">Send</button>

您不会进一步发布您的JavaScript。我想你使用了一个对话框模块,比如Bootstrap对话框。如果它是iframe或动态(注入)html中的对话框,请确保将事件绑定到元素。