add some comments, modified onSubmitValidation functions to take form element as parameter