Blood electrolytes are reduced as a result of increased sweating or the use of diuretics. Your cramps are most often caused by a drop in magnesium and calcium levels. Your cramps in your legs are caused by many problems, such as your uncomfortable shoes, your degenerative changes in the ankles, a bad sitting position etc …
Exercise, good blood circulation, at least a liter and a half of water a day and enough minerals, these are some of the ways to protect yourself from leg cramps.
Here’s a tip to successfully relieve cramps in the feet or in other parts of the leg. Hold your toes and pull them toward you, quickly and firmly.
I can tell you that it works because I use it frequently in case of cramps which prevents me the pain that remain in the calf when I get up in the morning.
Even if the pain is strong, keep your foot in this position, while massaging your tense muscles. You will feel relieved very soon.
Source HOW TO RELIEVE THE CRAMPS OF THE LEGS IN A FEW SECONDS! : and