How to avoid submitting a form when creating a new content, depending on some criteria?
You can add validation callbacks to any form in Drupal using the Form API. Specifically, you can use hook_form_alter to add a validation callback to the $form['#validate'] element.