document.addEventListener("DOMContentLoaded", function () {
  const form = document.getElementById("personalInfoForm");

  if (form) {
    form.addEventListener("submit", async function (e) {
      e.preventDefault();

      if (typeof window.showSaveChangesAlert === "function") {
        await window.showSaveChangesAlert("Personal Information");
      } else {
        alert("Personal Information changes saved successfully.");
      }

      window.location.href = "./profile.html";
    });
  }
});
