Cramp is an involuntary contraction of the muscle and is normally caused by muscle fatigue and/or lack of salts in the blood. It usually occurs after prolonged periods of vigurous activity, especially when little exercise has occured before this activity.
When standing up, muscles are constantly contracting in the foot to enable movement and to keep you balanced. These muscles, like all other skeletal muscles, will fatigue and this is when cramp can occur. Muscles also require certain salts to enable them to contract, and so it removes these from the blood. Eventually most of the salts will have been taken from the blood to enable muscle contracts and cramp may occur.
Cramp can usually be treated by stretching the muscle whilst massaging it. Also sufficent fluids and electrolytes should be taken on to both treat and prevent it.