Wetting accidents ("peeing in one's pants") at night and/or during the day may be a symptom of encopresis (functional constipation).
Nighttime wetting and daytime dripping or leaking are frequently due to a distended or stretched rectum caused by stool withholding. This is because the rectum and the urinary bladder are physically very close together. (See Chapter 9, page 66) If one or both of these organs are full they can easily press up against one another, increasing the chance of accidental wetting. I find that these accidents occur more frequently with children who wait until the last second to urinate.
It is also important to know that pressure on the urinary bladder by a distended rectum can make it difficult for the bladder to empty completely. Over time, especially for girls, incomplete emptying of the bladder can lead to a bacterial infection in the residual urine, commonly known as a urinary tract infection (UTI).
Since sudden onset daytime wetting accidents can also be caused by a urinary tract infection (UTI) parents would be wise to seek the opinion of their pediatric healthcare provider if the daytime accidents continue.