that happened to one of mine and i tossed it and bought a new one because i really could not think of an way to re-attach the foam to the plastic... sorry.
This has happened to a couple of my cats eyes inkpads and I have used some Pritt-gel (strong) glue. I squeezed it on to the base and then placed the actual inkpad ontop and gently pushed it in place. None of them have come off again. I use this gel glue for attaching any heavier metal embellisments to my cards etc and they are on forever.