Below the onset temperature To, the equilibrium relaxation time of most glass-forming liquids exhibits glassy dynamics characterized by a super-Arrhenius temperature dependence. In this supercooled regime, the relaxation dynamics also proceeds through localized elastic excitations corresponding to hopping events between inherent states, i.e., potential-energy-minimizing configurations of the liquid. Despite its importance in distinguishing the supercooled regime from the high-temperature regime, the microscopic origin of To is not yet known. Here, we construct a theory for the onset temperature in two dimensions and find that an inherent-state melting transition, described by the binding-unbinding transition of dipolar elastic excitations, delineates the supercooled regime from the high-temperature regime. The corresponding melting transition temperature is in good agreement with the onset temperature found in various two-dimensional (2D) atomistic models of glass formers and an experimental binary colloidal system confined to a water-air interface. Additionally, we find the predictions for the renormalized elastic moduli to agree with the experimentally observed values for the latter 2D colloidal system. We further discuss the predictions of our theory on the displacement and density correlations at supercooled conditions, which are consistent with observations of the Mermin-Wagner fluctuations in experiments and molecular simulations.