How to set a condition in order to skip the form to submit button