$('#salary_pension_form').on('submit', function (event) { event.preventDefault(); $.ajax({ url: "{{ route('employees.pension_update',$employee->id) }}", method: "POST", data: new FormData(this), contentType: false, cache: false, processData: false, dataType: "json", success: function (data) { console.log(data); var html = ''; if (data.errors) { html = '
' + data.errors[count] + '
'; } html += '