Emphasize field name in error message (see attached pictures).

Actually this is rather a feature request, but let's say it's a usability bug. Shouldn't be a problem to still get it into D6 though.

Comments

gábor hojtsy’s picture

I am not sure this is better. IMHO the normal font was used to provide a more readable sentence.

pancho’s picture

Status: Active » Needs review

Don't think that readability is a problem here. The sentences are short, and it is important that the user understands at first sight that the error message is referencing a specific field on this page: the field called E-mail address for example. We could also wrap the field name in single quotes, but that wouldn't be better. Think that this is the best solution indeed.

pancho’s picture

Title: Usability: Improve error messages on required and maxlength fields » String freeze: error messages on required and maxlength fields
Category: bug » task
keith.smith’s picture

Version: 6.x-dev » 7.x-dev

To quote Gábor from http://lists.drupal.org/pipermail/development/2007-December/027977.html: "RC1 is string freeze, so whatever needs modifications in the strings is generally postponed to Drupal 7."

pancho’s picture

Category: task » feature

Whow, this string freeze comes a bit early - there are still so many issues active...

pancho’s picture

Title: String freeze: error messages on required and maxlength fields » Usability: Improve error messages on required and maxlength fields

Changed back title

gábor hojtsy’s picture

Early? I hope the translators will not find it too late. Drupal 6 is a multilanguage release, so we'd like to see more translations getting ready by the release. Translators need time.

pancho’s picture

Gábor: Sure, I absolutely understand both the translators' needs and your urgent need to finally get this D6 release out! The point is, that I prefer the Debian style "Release is, whenever we're done." instead of setting fixed timeslots. But nevermind - if D6 were 100% perfect, there would be nothing to fix or improve anymore... :) Wish you Happy Christmas, and hope you can relax a bit after all tis work!

gábor hojtsy’s picture

Well, nobody said that the RC1 will be on any specific day, so I don't see where do we set any fixed timeslot. With all the previous major releases, there was a string freeze timed right with RC1 and was pre-announced several times, just as it happened in this case. There is nothing new about this. Happy Holidays!

dries’s picture

Status: Needs review » Closed (won't fix)

I'm marking this won't fix. I don't think it is an improvement.

roball’s picture

Title: Usability: Improve error messages on required and maxlength fields » Wrap field name within error message on required and maxlength fields into a class
Assigned: pancho » Unassigned
Issue summary: View changes
Status: Closed (won't fix) » Active

But why not using

form_error($elements, $t('!name field is required.', array('!name' => '<span class="message-field">' . $elements['#title'] . '</span>')));

instead of

form_error($elements, $t('!name field is required.', array('!name' => $elements['#title'])));

? This would then allow to use custom CSS like

.message-field {
  font-style: italic;
}

if you prefer emphasize field names (or styled in any way you like) in error messages, but would keep the format as it is if you don't set that CSS. Consider a field name Please select your favourite colors.. Currently, the user will be presented the following HTML error message:

Please select your favourite colors. field is required.

which is hard to understand. If the field name would be wrapped into a class as suggested above, the message would be

<span class="message-field">Please select your favourite colors.</span> field is required.

instead, allowing it to be clearly understood.

roball’s picture

Status: Active » Closed (won't fix)

Since this won't be fixed in Drupal 7 core, I have written the Better Form Errors module which solves this problem. Re-assigning the previous status to this issue.