The transformation behavior from glassy state was investigated in Zr- and Hf-based glassy alloys. The primary phases are metastable face-centered-cubic (fcc) Zr2Ni and fcc Hf2Ni phases in the Zr65Al7.5Ni10Cu17.5 and Hf65Al7.5Ni10Cu17.5 glassy alloys, respectively. By substitution of 5 at.% Pd for Cu, the primary phase changes to an icosahedral quasicrystalline phase in both alloys. It is found that the addition of elements, which have a positive or weak chemical affinity with one of the constitutional elements in the Zr-Al-Ni-Cu and Hf-Al-Ni-Cu glassy alloys, is effective for the precipitation of the icosahedral phase. It is suggested that Pd plays a dominant role in an increase in the number of nucleation sites. Since an icosahedron is contained as a structure unit in the icosahedral, fcc Zr2Ni and fcc Hf2Ni phases, it is implied that these phases are correlated with the local icosahedral order. The high-resolution transmission electron microscopy images of the as-spun Zr65Al7.5Ni10Cu7.5Pd10 and Hf65Al7.5Ni10Cu12.5Pd5 alloys reveal a possibility of the existence of the icosahedral ordered regions. It is therefore, concluded that the icosahedral short- or medium-range order exists and it stabilizes the glassy state in the Zr- and Hf-based multicomponent alloys.