This patch replaces the error handling of the current 4.6.x feedback.module.

Some advantages of using this patch are:

  • Fields that did not validate are highlighted.
  • Report errors on the same page as the form. This allows the user to quickly spot his/her errors.
  • No need for the user to navigate back to the feedback page after getting errors.
  • More consistent with usual Drupal behavior. Form validation everywhere else in Drupal uses form_set_error().

Also included in this patch:

  • Form data is now validated in the same order as the form fields, so that the ordering of the error messages remain consistent with the ordering of the fields in the page.
  • Changes to mark the mandatory fields (typically denoted with a red asterisk).
  • Slightly friendlier messages (such as "Please enter your full name" instead of "Error: Full name is required"). Users dislike "error" messages. :-)

If you would like to see this patch in action, try http://www.davidlesieur.com/contact (it is in French, though).

Comments

kbahey’s picture

Version: 4.6.x-1.x-dev » 6.x-2.x-dev
Assigned: Unassigned » kbahey
Status: Needs review » Fixed

Thank you for this patch. It is great.

I applied it to both CVS, and 4.6.

dries’s picture

Status: Fixed » Closed (fixed)