I often hear stories about enemies defeating elephant riders by axing the legs of the elephants.
Does this mean that the commander of the elephant army did not put enough armor on the elephants' legs?
An elephant is a very large animal. Putting the whole animal in armor would cost more in armor than the whole unit would be worth in warfare. (The same armor could be used to protect a large number of men.)
Therefore armor was used, if at all, to protect only the most vital parts of the animal, e.g., the temples. Most of the animal was unprotected. Of course, having men try to cut off their legs subjected the MEN to great risks.
Elephants proved not to be terribly effective in combat because they weren't as easy to control as horses, and would often "rebound" against the attackers. At the battle of zama, for instance, Hannibal relied on elephants to break through the Roman lines, without success.