   const cities = {
    Abia: ["ABA", "AROCHUKWU", "OHAFA", "UMUAHIA"],
    Abuja: ["APO", "BWARI", "CENTRAL AREA", "DURUMI", "GALADIMA", "GARKI", "GARKI II", "GUDU", "GWAGWADALA", "GWARIMPA", "JABI", "KARU", "KUBWA", "KURUDU", "LOKOGOMA", "LUGBE", "UTAKO", "WUSE"],
    Adamawa: ["YOLA"],
    AkwaIbom: ["EKET", "IKOT ABASI", "NNEWI", "NSUKKA", "UMUNZE"],
    Anambra: ["AKWA", "AWKA", "EKWULOBIA", "IGBO-UKWU", "IHIALA", "NNEWI", "NSUKKA", "ONITSHA", "ORBA", "UMUNZE"],
    Bauchi: ["AZARE", "BAUCHI"],
    Bayelsa: ["YENAGOA"],
    Benue: ["GBOKO", "MAKURDI"],
    Borno: ["MAIDUGURI"],
    CrossRiver: ["CALABAR", "IKOM", "OBUDU"],
    Delta: ["ABRAKA", "AGBARHO", "AGBOR", "ASABA", "KWALE", "OBIARUKU", "SAPELE", "UGHELLI", "WARRI"],
    Ebonyi: ["ABAKALIKI", "AFIKPO"],
    Edo: ["AUCHI", "BENIN", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR", "EKIADOLOR"],
    Ekiti: ["ADO EKITI", "IKOLE"],
    Enugu: ["ABAKPA", "EMENE", "ENUGU", "IGBOBI", "NSUKKA", "OBOLLO AFOR"],
    Gombe: ["ASHAKA", "GOMBE"],
    Imo: ["AKOKWA", "ORLU", "OWERRI"],
    Jigawa: ["DUSTE"],
    Kaduna: ["BARNAWA", "KADUNA SOUTH", "KADUNA TOWN", "KAFANCHAN", "SABONGARI", "ZARIA"],
    Kano: ["HAJJ CAMP", "HOTORO", "KANO", "KUMBOTSO", "NOMANSLAND", "ZARIA ROAD"],
    Kastina: ["FUNTUA", "KASTINA"],
    Kogi: ["ANKPA", "ANYIGBA", "IDAH", "LOKOJA", "OKENE"],
    Kwara: ["ILORIN", "OFFA", "OMU ARAN"],
    Lagos: ["ABULE EGBA", "AGEGE", "AJAH", "AJAO ESTATE", "AJEGUNLE", "AKOWONJO", "AKUTE", "ALAGBADO", "ALAKUKO", "AMUWO-ODOFIN", "APAPA", "BADAGRY", "BARIGA", "EBUTE METTA", "EGBEDA", "EJIGBO", "EPE", "FAGBA", "FESTAC TOWN", "GBAGADA", "IGANDO", "IFAKO-IJAYE", "IKEJA", "IKORODU", "IKOSI KETU", "IKOTUN", "IKOYI", "ILUPEJU", "IPAJA", "ISHERI", "ISOLO", "IYANA-IPAJA", "KETU", "KIRIKIRI TOWN", "LAGOS ISLAND", "LEKKI", "MENDE MARYLAND", "MILE 12", "MUSHIN", "OBALENDE", "OBANIKORO", "OGBA", "OGUDU", "OJO", "OJODU", "OJOTA", "OKOKOMAIKO", "OMOLE PHASE 1", "ONIKAN", "ORILE IGANMU", "OSHODI", "OWORONSHOKI", "SANGO OTA", "SATELLITE TOWN", "SHASHA", "SHOMOLU", "SURULERE", "VICTORIA ISLAND", "YABA"],
    Nasarawa: ["AKWANGA", "KEFFI", "MARARABA"],
    Niger: ["BIDA", "MINNA", "SULEJA"],
    Ogun: ["ABEOKUTA", "ALAGBADO", "AREPO", "IPERU-REMO", "IJEBU-ODE", "ILISHAN REMO", "ITORI", "MAGBORO", "MOWE", "SAGAMU", "SANGO OTA"],
    Ondo: ["AKOKO", "AKURE", "OKITIPUPA", "ONDO TOWN", "ORE", "OWO"],
    Osun: ["ILE IFE", "ILESA", "IWO", "OSOGBO"],
    Oyo: ["IBADAN", "ISEYIN, SAKI", "OGBOMOSHO", "OYO TOWN"],
    Plateau: ["JOS"],
    Rivers: ["BONNY ISLAND", "ELEKAHAI", "ELEME", "ELENLEWO", "OMOKU", "ONNE", "PORT HARCOURT", "RUKPOKWU", "TRANS AMADI", "WOJI"],
    Sokoto: ["MARMARU NUPAWA"],
    Taraba: ["JALINGO"],
    Yobe: ["DAMATURU"],
    Zamfara: ["GUSAU"]
};

function populatecity() {
  const stateSelect = document.getElementById("input_20_state");
  const citySelect = document.getElementById("city");
  const selectedState = stateSelect.value;

  // Clear the current options in the local government select
  citySelect.innerHTML =
    '<option value="">Select City</option>';

  // Check if a state is selected
  if (selectedState) {
    // Get the local governments for the selected state
    const statecities = cities[selectedState];

    // Populate the local government select with options
    statecities.forEach((statecity) => {
      const option = document.createElement("option");
      option.value = statecity;
      option.textContent = statecity;
      citySelect.appendChild(option);
    });
  }
}

function populatedepen1city() {
  const stateSelect = document.getElementById("depen1input_20_state");
  const citySelect = document.getElementById("depen1city");
  const selectedState = stateSelect.value;

  // Clear the current options in the local government select
  citySelect.innerHTML =
    '<option value="">Select City</option>';

  // Check if a state is selected
  if (selectedState) {
    // Get the local governments for the selected state
    const statecities = cities[selectedState];

    // Populate the local government select with options
    statecities.forEach((statecity) => {
      const option = document.createElement("option");
      option.value = statecity;
      option.textContent = statecity;
      citySelect.appendChild(option);
    });
  }
}

function populatedepen2city() {
  const stateSelect = document.getElementById("depen2input_20_state");
  const citySelect = document.getElementById("depen2city");
  const selectedState = stateSelect.value;

  // Clear the current options in the local government select
  citySelect.innerHTML =
    '<option value="">Select City</option>';

  // Check if a state is selected
  if (selectedState) {
    // Get the local governments for the selected state
    const statecities = cities[selectedState];

    // Populate the local government select with options
    statecities.forEach((statecity) => {
      const option = document.createElement("option");
      option.value = statecity;
      option.textContent = statecity;
      citySelect.appendChild(option);
    });
  }
}

function populatedepen3city() {
  const stateSelect = document.getElementById("depen3input_20_state");
  const citySelect = document.getElementById("depen3city");
  const selectedState = stateSelect.value;

  // Clear the current options in the local government select
  citySelect.innerHTML =
    '<option value="">Select City</option>';

  // Check if a state is selected
  if (selectedState) {
    // Get the local governments for the selected state
    const statecities = cities[selectedState];

    // Populate the local government select with options
    statecities.forEach((statecity) => {
      const option = document.createElement("option");
      option.value = statecity;
      option.textContent = statecity;
      citySelect.appendChild(option);
    });
  }
}

function populatedepen4city() {
  const stateSelect = document.getElementById("depen4input_20_state");
  const citySelect = document.getElementById("depen4city");
  const selectedState = stateSelect.value;

  // Clear the current options in the local government select
  citySelect.innerHTML =
    '<option value="">Select City</option>';

  // Check if a state is selected
  if (selectedState) {
    // Get the local governments for the selected state
    const statecities = cities[selectedState];

    // Populate the local government select with options
    statecities.forEach((statecity) => {
      const option = document.createElement("option");
      option.value = statecity;
      option.textContent = statecity;
      citySelect.appendChild(option);
    });
  }
}
function populatespousecity() {
  const stateSelect = document.getElementById("spouseinput_20_state");
  const citySelect = document.getElementById("spousecity");
  const selectedState = stateSelect.value;

  // Clear the current options in the local government select
  citySelect.innerHTML =
    '<option value="">Select City</option>';

  // Check if a state is selected
  if (selectedState) {
    // Get the local governments for the selected state
    const statecities = cities[selectedState];

    // Populate the local government select with options
    statecities.forEach((statecity) => {
      const option = document.createElement("option");
      option.value = statecity;
      option.textContent = statecity;
      citySelect.appendChild(option);
    });
  }
}


