Each child has an expression they use or something they say when they want to use the potty (toilet) without actually declaring so, what did / does your child do? For my son, he always does a little dance or holds just below his belly button with his two hands.
When she was younger, there was generally no warning whatsoever -- just look out, because there is a mess! Now I can tell when she begins to just be "antsy" and squirming around. Sometimes she gets really wild, dancing and shouting and just generally trying to distract herself from having to "go." I keep telling her, you have to "go" whether you want to or not (she thinks it's gross and doesn't like to do it at all). It's just a part of life.