jeudi 17 septembre 2020

I want to reload the page on button click and perform the route action in new tab

<form action="" method="post" >
                                @csrf
                                <div class="row">
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <select id="payment_method" class="form-control" name="payment_method" required>
                                                <option value="" selected="selected" disabled="disabled">Payment</option>
                                                <option value="cash">Cash</option>
                                                <option value="credit">Credit</option>
                                                <option value="debit">Debit</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-sm-1">
                                    <input type="text" name="driver" value="" hidden>
                                    </div>
                                    <div class="col-sm-5">
                                        <button class="btn btn-primary" style="background-color: #262533; border-color: #262533" onClick="refreshPage()" formtarget="_blank">All Entries Paid</button>
                                    </div>
                                </div>
                            </form>

This is my form. I am using onClick="refreshPage()" to refresh my page.

<script>
    function refreshPage(){
        window.location.reload();
    }
</script>

This is the script. But when i press the button. It just reloads the page and also not going on the route. I want to reload the page and open another tab to perform the route action.

Any Help? Thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire