Most of the time developers deals with ERROR, SUCCESS, FAIL actions either with/without form. And <p>, <div>
or other elements are widely used with classes like .error, .fail, .success. But I think could be more intuitive way for such responses. Instead of these traditional elements, W3C should introduce (or have debate on) following elements with given optional properties:
<fail redirect="/register/">Cannot proceed. Try again later.</fail>
<error redirect="/help/">Invalid credit card number.</error>
<success redirect="/cart/book/14">Thanks for your feedback!</success>
<message redirect="/news/">HTML5 is pretty!</message>
<warning>Requesting URL has malicious content.</warning>
Another way using self close instead closing tag:
<success value="Thanks for your feedback!" redirect="/cart/book/14" />
value
represents for text to be displayed after receiving the response and redirect
(optional) can be use to redirect the existing page to the desired location.
Then the CSS would be much simpler and meaningful.
fail, error, success, message, warning{
color: #fff;
padding: 4px 8px;
}
fail{ background: #8B654C; }
error{ background: #CB5050; }
success{ background: #5D9F44; }
message{ background: #5393AD; }
warning{ background: #A7A627; }
The styled output would be:
Fail: Cannot proceed. Try again later.
Error: Invalid credit card number.
Success: Thanks for your feedback!
Message: HTML5 is pretty!
Warning: Requesting URL has malicious content.
These elements are certainly good, meaningful and has potential to get introduced in HTML5.
Leave a Reply