Skip to content

Feedback email validation is broken and allows invalid submissions #8

@codeCraft-Ritik

Description

@codeCraft-Ritik

Summary:

The feedback form validation logic is incorrect and references non-existent form objects, so validation does not work reliably. In practice, valid emails are treated as invalid, and invalid emails can still get submitted.

Description:

The validation script reads from patient and doctor forms, but the actual form name is feedback. Also, the regex condition is reversed:

  • If email matches format, it shows invalid message.
  • If email does not match format, it returns true.

This causes incorrect behavior and potential JS runtime errors.

Steps to Reproduce:

  1. Open feedback page.
  2. Enter a valid email (example : user@example.com
  3. Submit form.
  4. Observe invalid message or JS error.
  5. Try invalid email and submit; it can pass.

Expected:

Only invalid emails should be blocked, valid emails should submit.

Actual:

Validation is inverted and references wrong form names.

Impact:

User-facing bug, bad UX, and weak input validation before reaching backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions