In this work, we present an explanation of the electric charge quantization based on a semi-classical model of electrostatic fields. We claim that in electrostatics, an electric charge must be equal to a rational multiple of the elementary charge of an electron. However, the charge is quantized if the system has certain boundary conditions that force the wavefunction representing an electric field to vanish at specific surfaces. Next, we develop the corresponding model for the electric displacement vector. It is demonstrated that a number of classical results, e.g. bending of field lines at the interface of two dielectric media, method of images, etc. are all consistent with the predictions of this model. We also present the possible form of Gauss’s law (or Poisson’s equation), to find the wavefunctions of the field from a source charge distribution, in this model.