i not only kept the lid closed but i closed the bathroom door.
to teach my dog not to go in the bathroom i use to place
a treat or food just across the door sill. when my pup went inside
the bathroom for the food i would say "out". sometimes i said "out,
don't come in hear". he learned. to test him to make sure he wasn't
going into the bathroom i use to place a treat or food on the toilet
lid (on a plate or aluminum foil) and leave the area or leave the house
for a few minutes. if the food was gone i would place more food on the
toilet lid and get my pup and show him the food and say "no". in due
time with repeat training he learned no to go into the bathroom
whether we were home or not.
there's no need to abuse a pup by smacking it, rubbing it's nose
in it's accident, yanking on the pup, yelling at the pup, holding
the pup down, rolling the pup on it's back, crate punishment, etc.