Unable to accept validation

Unable to accept the validations using the alert or even contains validations