简体   繁体   中英

Dialog form in form action laravel 5.1

I have the following form action:

<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>

If I click on submit button in dialog it will store all transactions and input in dialog. That happens if submit in dialog nothing happen.

Can you give me a solution for this problem?

You've the type attribute for 2 times. Remove the type="button" in the send button.

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

You don't further post your JavaScript. I suppose that you use a dialog module, such as Bootstrap dialog. If it's a dialog in an iframe, or dynamic (injected) html, make sure that the events are binded to the elements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM