<form method="POST" action="{{route('ajax-post', ['name'=>'edit_university_save'])}}" class="edit_university_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-4">
                <div class="mb-2">
                    <label class="form-label config">Destination</label>
                    <div class="form-icon position-relative"> 
                        <select name="country_id" id="country_id" class="form-control" required="" style="font-size: 13px;">
                            <option value="" selected disabled>Select</option>
                            @foreach($market_countries as $row)
                                <option value="{{$row->country_id}}" @if($row->country_id==$edit_data->country_id) selected @endif>{{ cn($row, 'country.name','')}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="mb-2">
                    <label class="form-label config">University Name</label>
                    <div class="form-icon position-relative">
                        <input type="text" class="form-control" placeholder="University Name" id="university_name" name="university_name" value="{{$edit_data->name}}" required="" style="font-size: 13px;">
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="mb-2">
                    <label class="form-label config">University Website</label>
                    <div class="form-icon position-relative">
                        <input type="text" class="form-control" placeholder="University Website" id="university_website" name="university_website" value="{{$edit_data->web_address}}" required="" style="font-size: 13px;">
                    </div>
                </div>
            </div>
        </div>  
        <div class="row">
            <div class="col-md-12">
                <div class="text-end">
                    <button type="button" class="btn cancel_button mr-1 btn-cancel close_form" 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"></i>
                    </button>
                    <button class="btn btn2" id="submit_uni">Update</button>                                                                                                                
                </div>
            </div> 
        </div>  
    </div>
      
</form>

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

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