Apologies, awful subject, but am sticking with the line of the post: When around 15-16 years old and travelling on a bus I suddenly felt an enormous sense of urgency - I was unable to hold on and filled my pants. Luckily for me it was sufficiently solid to not significantly go past there, I took over the single men's toilet at the bus station on arrival and proceeded to clean up. Very many irate people banged on the door but this was always going to take quite a while. You may be able to imagine my embarrassment (the pants went with the flush).
The point of telling this is that this is not at all an unknown thing - when, rather worried, I told my schoolmate about this he was very calm about it and used an expression which came straight from the colloquial dictionary, self explanatory and clearly widely used expression suggesting everyone knows about this sort of thing. My relief was considerable - that was 55 years ago and it never again happened to me.
You likely have some form of infection of the digestive tract and may need medication to bring it under control. My incident showed no further signs at all and no intervention was ever carried out, testimony to youth and otherwise robust health, I assume. I have had other bouts of similar illness but never with similar consequences, although I have become quite ill. In Nigeria I was introduced to an extraordinary tablet called Thalazole - it works extremely quickly and knocks these things devastatingly on the head - I often refer to it as a drain cleaning plug (proceeds from one end and removes all before it to the other end). When I asked at my local pharmacy in the UK, the man had never heard of it, went through successive tomes and eventually found something. His expression darkened as he read through, then slammed it shut and said it was "not used here". Subsequently I googled and traced some reference to it being used on calves...... I still keep several tablets, just in case I or someone else needs one (and usually that is all you need) - there will be people who would be horrified at the thought but the stuff has more than once brought me back to life in Africa and India.