add condition and validation

add condition when can submit the form and validation of form (using CI validation)