/** * Validator javascript include */ validator = { /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// _hasErrors: [], hasErrors: function(errors) { return this._hasErrors[errors] == true; }, /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// collectErrorIds: function(errors) { result = ''; for (var id in errors) { if (result != '') result += ','; result += id; } return result; }, /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// clear: function(errors) { // unattached for (var id in errors) { try { if (errors[id].element == null) continue; jQuery(errors[id].element).html( this.composeUnattachedMessage(false, null) ); } catch (ex) { } } // attached - affected inputs var _validator = this; jQuery(".validator-affected").removeClass("validator-affected").each( function(ind) { _validator.detachTooltip(jQuery(this)); } ); // attached jQuery(".validator-group").css("display", "none").empty(); }, composeUnattachedMessage: function(isError, msg) { if (!isError) { return " "; } var html = "
"; return html; }, composeUnattached : function(errors, data) { for (var id in data) { try { if (errors[id].element == null) continue; jQuery(errors[id].element).html( this.composeUnattachedMessage(data[id].error, data[id].message) ); } catch (ex) { } } }, composeAttachedMessage: function(msg) { var html = "