      <div class="modal fade" id="edit-image">
          <div class="modal-dialog modal-sm">
              <div class="modal-content">
                  <div class="modal-header">
                      <h4 class="modal-title">Manage Beneficiaries</h4>
                      <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                          <span aria-hidden="true">&times;</span>
                      </button>
                  </div>
                  <div class="modal-body">
                     <form enctype="multipart/form-data" method="POST">
                          <div id="msg-edithouseholdimage"></div>
                          <div class="form-group">
                              <label>Image:</label>
                              <input type="file" id="img_imageprofile" alt="img_imageprofile" class="form-control" >
                          </div>
                  </div>
                  <div class="modal-footer justify-content-between">
                      <input type="hidden" id="img_beneficiariesid" name="">
                      <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                      <button type="button" class="btn btn-primary" id="Edit-img">Update</button>
                  </div>
                  </form>
              </div>
          </div>
      </div>
      <script>
          document.addEventListener('DOMContentLoaded', () => {
              let btn = document.querySelector('#Edit-img');
              btn.addEventListener('click', () => {

                  const image_profile = document.querySelector('input[id=img_imageprofile]').value;
                  const beneficiaries_id = document.querySelector('input[id=img_beneficiariesid]').value;

                  var data = new FormData(this.form);
                 data.append('image_profile', $('#img_imageprofile')[0].files[0]);
                 data.append('beneficiaries_id', beneficiaries_id);

                      $.ajax({
                          url: '../../controllers/edit_householdImage.php',
                          type: "POST",
                          data: data,
                          processData: false,
                          contentType: false,

                          async: false,
                          cache: false,

                          success: function(data) {
                              $('#msg-edithouseholdimage').html(data);

                          },
                          error: function(data) {
                              console.log("Failed");
                          }
                      });
                  //}

              });
          });
      </script>