You are approaching this problem from the wrong angle. Instead of having the FormCheck function execute when the button is clicked, you should make sure that the FormCheck function is executed when the form is submittedno matter how. To do so, remove it from the button's OnClick event and place it in the Form's OnSubmit event.
Within FormCheck, make sure you return true or false. If the function returns true, the form's submission will go through. If false, the form will not be submitted.