Index: simple_grid.js =================================================================== --- simple_grid.js (revision 13571) +++ simple_grid.js (working copy) @@ -67,30 +67,25 @@ return document.getElementById($prepend + this.FieldMask.replace('#FIELD#', $field_name).replace('#ID#', $id) + $append); } -SimpleGrid.prototype.markError = function ($item_id, $field_name, $error_found) { +SimpleGrid.prototype.markError = function ($item_id, $field_name, $error_found, $error_message) { if (!isset($error_found)) { $error_found = true; } - var $field = this.getField($item_id, $field_name); + var $field = $( this.getField($item_id, $field_name) ); + if ($error_found) { - $field.style.backgroundColor = '#EF2C2C'; + $field.css('background-color', '#EF2C2C').attr('title', $error_message === undefined ? '' : $error_message) // TODO: duplicate focus events possible on one element, fix this later - addEvent($field, 'focus', + .focus( function($e) { - if (!$e) { - $e = window.event; - } - - var $element = document.all ? $e.srcElement : $e.currentTarget; - $element.style.backgroundColor = ''; + $(this).css('background-color', '').attr('title', ''); } - ); } else { - $field.style.backgroundColor = ''; + $field.css('background-color', '').attr('title', ''); } }