We develop a continuum hydrodynamic model for two-phase immiscible flows that involve electroosmotic effect in an electrolyte and moving contact line at solid surfaces. The model is derived through a variational approach based on the Onsager principle of minimum energy dissipation. This approach was first presented in the derivation of a continuum hydrodynamic model for moving contact line in neutral two-phase immiscible flows (Qian, Wang, and Sheng, J. Fluid Mech. 564, 333-360 (2006)). Physically, the electroosmotic effect can be formulated by the Onsager principle as well in the linear response regime. Therefore, the same variational approach is applied here to the derivation of the continuum hydrodynamic model for charged two-phase immiscible flows where one fluid component is an electrolyte exhibiting electroosmotic effect on a charged surface. A phase field is employed to model the diffuse interface between two immiscible fluid components, one being the electrolyte and the other a nonconductive fluid, both allowed to slip at solid surfaces. Our model consists of the incompressible Navier-Stokes equation for momentum transport, the Nernst-Planck equation for ion transport, the Cahn-Hilliard phase-field equation for interface motion, and the Poisson equation for electric potential, along with all the necessary boundary conditions. In particular, all the dynamic boundary conditions at solid surfaces, including the generalized Navier boundary condition for slip, are derived together with the equations of motion in the bulk region. Numerical examples in two-dimensional space, which involve overlapped electric double layer fields, have been presented to demonstrate the validity and applicability of the model, and a few salient features of the two-phase immiscible electroosmotic flows at solid surface. The wall slip in the vicinity of moving contact line and the Smoluchowski slip in the electric double layer are both investigated. © 2012 Global-Science Press.