S.M.
Hi N.,
You may want to ask your Dr. however my son went through the same thing off and on until he was 9. The Dr. told me it was growth spurts, the nerves and muscles grow at a different pace and the muscles used to control pee and poop may not be getting the nerve responses during the growth spurts. They generally outgrow this within a few weeks or month, pull ups are great during this time period.
Generally it is very embarrassing for the child. I explained all the medical stuff to my son so he didn't feel bad about it and I didn't mention it around anyone else. After he understood what was happening he would come tell me when he started having a hard time controlling it again, pull ups for awhile and back to normal again.
Like I said, he is 9 now and hasn't had another episode for probably 6 months. Always good to check with the Dr. and make sure it isn't a bladder infection or something else.
Good luck,
SarahMM