<div class="col-md-12 mb-4 mt-4 open_education_edit_info_div">
    <div  style="width: 100%;">
        <div class="panel-body" style="padding:10px; background-color: #4b4c6824;  border: 1px solid #e9e5e5; border-radius: 5px;">
            <form method="POST" action="{{route('ajax-post', ['name'=>'update_education_history'])}}" class="edit_form"> 
                <input type="hidden" name="_token" value="{{ csrf_token() }}" />
                <input type="hidden" name="edit_id" value="{{$edit_data->id}}">
                <div class="row">
                <div class="col-md-4">
                    <div class="mb-1">
                            <label class="form-label">Academic level <span class="text-danger">*</span></label>
                        <div class="form-icon position-relative">
                            <select name="academiclevel" id="academic level" class="form-control frm" required="">
                                   <option disabled="" selected="" value="">Choose one....</option>
                                @foreach($academic_level as $row)
                                    <option value="{{$row->id}}" @if($edit_data->academic_level ==$row->id) selected @endif>{{$row->name}}</option>
                                @endforeach                                                                                          
                               
                            </select>
                        </div>
                    </div>
                </div> 

                <div class="col-md-4">
                    <div class="mb-1">
                            <label class="form-label" for="subject">Subject <span class="text-danger">*</span></label>
                        <div class="form-icon position-relative">
                            <input type="text" for="subject" name="subject" value="{{$edit_data->subject}}" class="form-control ps-2" required="">
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                        <div class="mb-1">
                            <label class="form-label" for="">Institution<span class="text-danger">*</span></label>
                        <div class="form-icon position-relative">
                            <input type="text"  for="institution" name="institution" value="{{$edit_data->institution}}" class="form-control ps-2" placeholder="" required="">
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="mb-1">
                            <label class="form-label">Passing Year <span class="text-danger">*</span></label>
                        <div class="form-icon position-relative">
                            <select name="passingyear" id="passing year" class="form-control frm" required="">
                                <option disabled="" selected="" value="">Year</option> 
                                @foreach($passingyear as $row)
                                <option value="{{$row}}" @if($edit_data->passing_year==$row) selected @endif>{{$row}}</option>
                                @endforeach 
                            </select>
                        </div>
                    </div>
                </div>

                <div class="col-md-4">
                    <div class="mb-1">
                            <label class="form-label">Result <span class="text-danger">*</span></label>
                        <div class="form-icon position-relative">
                            <input type="text" class="form-control ps-2" name="result" value="{{$edit_data->result}}" placeholder="" required="">
                        </div>
                    </div>
                </div>
                </div>
                <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">Update</button>                      
                    </div>
                </div>
                
            </form>  
        </div>
    </div>
</div>
 

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

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