Formation and eruption of solar prominences