Doctor-Appointment icon indicating copy to clipboard operation
Doctor-Appointment copied to clipboard

Feedback email validation is broken and allows invalid submissions

Open codeCraft-Ritik opened this issue 8 months ago • 0 comments

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 : [email protected]
  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.

codeCraft-Ritik avatar Mar 24 '26 12:03 codeCraft-Ritik