Other moms have already replied with this, but I feel it is SUPER important to say it one more time --> DIET is a huge culprit, and COW'S MILK PRODUCTS are some of the *most common* offenders in our culture. Here is a wonderful chart from a pediatrician's website on how food sensitivities or allergies can affect the body, and you'll see that constipation is one of the symptoms (and one that is often overlooked - food allergies are frequently misdiagnosed!):
http://www.askdrsears.com/html/4/t041800.asp#T041803
You don't need a pediatrician or an expensive, painful blood test by a specialist, or ridiculous amounts of laxative or mineral oil or other chemicals to try this simple test and see if it helps your toddler: remove all cow's milk products for a period of 3 weeks, and don't substitute with soy - instead use rice milk or oat milk for the 3 week period. That means no cow milk, no yogurt, no cheese, no sour cream, no ice cream, no butter, and reading labels for ingredients like whey, casein, whole milk, condensed milk, lactase, etc. (here's a helpful cheat sheet http://www.kellymom.com/store/freehandouts/hidden-dairy01... ).
Within 3 weeks, if you're really sticking to a dairy-free (no cow's milk products) diet during that whole time, you should be able to tell whether your toddler's constipation is no longer happening, or whether it's still a problem.
If he is still constipated after 3 weeks, you can probably feel confident about cow's milk not being the cause. Perhaps it is something else he's eating/drinking -- you can keep a food diary of what he eats to see if you can make any connections between what he eats and when he is constipated. If that doesn't give you any direction, then I'd probably want to have my kid see a GI specialist just to get checked out and make sure it's not something more serious.
BUT, if he's no longer constipated after 3 weeks of a dairy-free diet, you can pretty much assume that cow's milk is the problem. Then you'd want to talk to your ped and a registered dietician (RD) to learn how to make more permanent dairy-free lifestyle/diet changes while maintaining optimal nutrition.
I just wanted to reply and encourage you to really consider your son's diet (probably something he eats daily or very frequently because he's been chronically constipated for the last 6 mos) because it's really something simple, free, and safe to change that could really solve the root cause of his constipation. The other stuff (mirilax, mineral oil, excessive fruit juices) is just a band-aid to treat the symptom of constipation, but won't really solve anything.
In the end, it might not be his diet -- but you cannot *really know that* until you actually test by removing something he's eating regularly to see whether his constipation goes away. Does that make sense? Then you can have a much more confident idea about whether his diet is, or isn't, the cause of his constipation.
Best of luck to you and your son - I *know* first hand that it's not comfortable or fun for either of you to be dealing with this... but hang in there and keep searching, and I'm sure you'll figure it out!