M.S.
Our senior dog started doing this at about 9 years old. Are you sure it isn't medical? It was simply her muscles not being as tight as they used to be, leading to incontinence. Our vet compared it to women (humans) as they get older, also. The only way to find it is to actually try the meds and rule it out. Our dog was put on d.e.s. and it worked like a miracle! There are other meds to try, also.
I agree with not locking her in a crate all day. Why have a dog if you are going to do this?