<form method="POST" action="{{route('ajax-post', ['name'=>'update_publication'])}}" class="edit_publication_info_form">  
    <input type="hidden" name="_token" value="{{ csrf_token() }}" />
    <input type="hidden" name="edit_id" value="{{$edit_data->id}}">
    <input type="hidden" name="action" value="edit"> 
    <div class="panel-body" style="padding:10px; background-color: #4b4c6824; border: 1px solid #e9e5e5; border-radius: 5px;"> 
    <div class="row">
        <div class="col-md-5">
            <div class="mb-1">
                    <label class="form-label">Publication  <span class="text-danger">*</span></label>
                <div class="form-icon position-relative">
                    <input type="text" class="form-control ps-2" name="publication" value="{{$edit_data->publication}}" placeholder="" required="">
                </div>
            </div>
        </div> 
        <div class="col-md-5">
            <div class="mb-1">
                    <label class="form-label">Status<span class="text-danger">*</span></label>
                <div class="form-icon position-relative">
                    <select name="status" id="status" class="form-control frm" required="">
                            <option disabled="" selected="" value="">Choose one....</option>
                            <option value="1" @if($edit_data->status==1) selected @endif>Published</option>                                                                                    
                            <option value="2" @if($edit_data->status==2) selected @endif>Under Review</option>                                                                                    
                            <option value="3" @if($edit_data->status==3) selected @endif>Draft stage</option>                                                                                    
                    </select>
                </div>
            </div>
        </div>
        <div class="col-md-2">
            <div class="mt-4 pt-3">
                <div class="text-end"> 
                    <button type="button" class="btn cancel_button mr-1" style="background-color: #ffbd59 !important; border: 2px solid #ffbd59; color: white;border-radius: 18px; padding: 2px 6px;">
                        <i aria-hidden="true" class="fa fa-refresh icncl"></i>
                    </button>
                    <button class="btn btn2" id="publication_update">Update</button>                                                                                                                
                </div>
            </div>
        </div>                                                                                                                                           
    </div>
    </div>
</form>

<script>
    $(function(){
        $('.edit_publication_info_form').on('submit', function(event){
                event.preventDefault();
                var self = $(this); 
                ajax_form(self, function(self){
                    $('#edit_publication_load').empty();
                    fetch_sub_content(
                        '#publication_load',
                        "{{ route('sub-content', ['name'=>'publication_list_load']) }}"
                    );  
                });
        });
    });

    $('.cancel_button').on('click', function(){ 
        $('.edit_data').addClass('d-none')
    });
</script>
    