dashinja/recipeciprocity

Form Validation: No Submit if Not Valid

Closed this issue · 0 comments

User Story

As an admin, I do not want the user form to be able to submit unless all fields pass validation, so that no junk gets into our database.

Acceptance Criteria:

  • Recipe Submit Form submits if and only when all fields validate
  • Recipe will not submit if any field is invalid

Notes:

  • The notes field is optional, and though it has validation, it only attempts to validate if user attempts to input data.

Suggestion:

Try a condition that looks for "true" on class of .error If exists, disallow form submission. Form fields that do not valid have the "error class" on the input tag.

By comparison, the same input fields have classes of .valid when form is validated.