Often after a child has had a bad constipation episode it will put them off for a very long time.
Not talking days or weeks... can often be for months.
They remember that pain and discomfort each time they feel the need to do a poo, and then hold it, if this pattern keeps up for too long the trouble can really start.
It is very important to keep their poo soft, you may need to use Lactulose regularly if they have ongoing constipation.
Lactulose is extremley safe, there is absolutley no problem for daily,long term use (for months @ a time), so if you need to use it for your children or yourself for that matter do so without any fear of becoming dependant on it...it WILL NOT happen!
If constipation is ongoing it can become ENCOPRESIS, My 5.7 year old is just starting to get over this. It has taken nearly a year. I would suggest you google encopresis so you can begin to understand it.
I am not saying EVERY child that gets constipated will get encopresis, but SOME will.
Just keep the poo soft, and on the whole try to not make too big an issue of it, better out than in no matter where!