Cramps in legs and other muscles can be due to overextension of the muscles,overweight,prolonged standing during the day,dehydration, alterations in the balance of salts in the bloodstream (such as a high or low sodium,calcium or potassium level),neuropathy(esp in diabetes),hypothyroidism,
peripheral vascular disease(narrowing of the leg arteries which causes poor circulation),sarcoidosis,excess alcohol,nerve compression, and sometimes liver disease.