<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">There are various possible solutions to replace error and warning, some<br>of which include the following. (This is just brainstorming, neither of
<br>these are particularly well thought out ideas.)<br><br>1. New <attn> element (short for 'attention'), which is specifically for<br>attracting the users attention, which is exactly what errors and<br>warnings do.
<br><br>2. A new attribute on <label> to associate it with a related error message.<br>e.g. <label for="ctrl" attn="ctrl-error">Foo</label><br> <input id="ctrl"><br>
<span id="ctrl-error">You filled in an incorrect value</span><br><br>The <attn> element is more generic and could probably solve other<br>similar use cases, whereas the the label attribute would only
<br>specifically solve the form error use case.<br><br>--<br>Lachlan Hunt<br><a href="http://lachy.id.au/">http://lachy.id.au/</a><br></blockquote></div><br>I like the idea of an <attn> element more than the other given ideas for associating a message with a form or form control. It should have a "for" attribute, like label:
<br><label for="password">Enter your new password</label><input id="password"><attn for="password">Your password is too short</attn><br><br>In combination with a "role" attribute, it would solve issues with form controls:
<br><label for="password">Enter your new
password</label><input id="password"><attn
for="password" role="error">Your password is too short</attn><br><br>An <attn> can attach to <form> and <fieldset> elements as well. <br><form id="login"><attn role="error" for="login">Logging in was unsuccessful</attn>...</form>
<br><br>There might be a use case were <attn> might be able to attach to other non-form elements. I can't think of a compelling one.<br><br>(The idea of an "attn" attribute above leaves the error message twice removed from its form control)
<br><br>I like the idea of a "role" attribute for reasons other than that it's new and doesn't conflict with exiting "class" attributes. Authors assume that the class attribute is theirs to use for scripting and styling without outside interference from the UA. Author's don't assume this about the "rel" attribute. Authors assume that the UA will assign meaning and function to the "rel" attribute, such as rel=next. HTML4 leaves the possible values for "rel" open-ended, but authors don't use it willy-nilly. However, rel=nofollow exists because UAs decided to support it. "role" should have the same type of existence.
<br><br>I don't think XHTML2's example values for "role" are useful (except "note" and "search"). "error" and "warning" are good useful examples. In the same vein, I would add "confirmation" or "success".
<br><br>-- <br>Jon Barnett