Some good suggestions here already. I'll add one that worked for my DD re: distraction.
Get her to stop what she's doing and help you clean up when she has an accident. She will soon figure out that going to the toilet is quicker than cleaning up an accident. Emphasise that she has to stop playing, clean up the floor, clean up herself, put her knickers / clothes in to soak, get clean knickers / clothes etc.... Make multiple steps so it takes ages.
My DD cottoned on pretty quickly that going for a "quick try" meant back to the toys faster than an accident.