onSubmit is being null checked when it should be length checked

Fixed a couple of if statements that check whether onSubmit is provided.