Set the vairable on form submit.