A new thiourea and urea functional monomers were synthesized. A series of hydrogels were prepared by photopolymerization. The hydrogels were used for the removal of Pb(II) and Cd(II) ions from aqueous solutions. The influence of the uptake conditions such as the pH, the time, and the initial feed concentration on the metal ion binding capacity of hydrogel was tested. The selectivity of the hydrogels towards the different metal ions was also tested. The adsorption isotherm models were applied. The limits of detection and quantification were calculated. The usability of the hydrogels for preconcentration studies were also investigated.