markers for field errors

This commit is contained in:
Crack
2010-06-21 16:24:34 +02:00
parent 3a8de5a716
commit 0dc5d2e2b1
5 changed files with 38 additions and 12 deletions

View File

@@ -299,6 +299,13 @@ function displayErrors(error_list) {
return item != '';
});
// CSS error class
if (!isFieldset) {
// checkboxes uses parent <span> for marking
var fieldMarker = (field.attr('type') == 'checkbox') ? field.parent() : field;
fieldMarker[errors.length ? 'addClass' : 'removeClass']('field-error');
}
if (errors.length) {
// if error container doesn't exist, create it
if (errorCnt.length == 0) {