1 week ago

Ajax to pass onchange

Posted 1 week ago by sarky

Good day guys

Trying to pass data and update the database on.change of a Select option

At the moment It is passing the information but only working on the first Select Option and not the second or 3rd.....

Can someone have a look and tell me what I am doing wrong or omitted ?

Cheers in advance

<form method="POST" id="changeorder">

                        <select name="orderid" id="orderid" class="custom-select" data-live-search="true">
                            <option selected>Open this select menu</option>
                        @foreach($orders as $order)
                            <option value="{{$order->id}}|{{$deliver->id}}" {{ $order->id == $deliver->order_id ? 'selected' : '' }}>{{$order->customer->name}}

Below is the script I am using

        let changeorder =  $('#changeorder').serialize();
            url: '/delivery/changeorder',
            data: changeorder,
            type: 'POST',
            success: function(response) {

Thanks again Sarkis

Please sign in or create an account to participate in this conversation.