return (this.validState !== false);
},
+ /**
+ * Returns the current validation error
+ *
+ * @instance
+ * @memberof LuCI.ui.AbstractElement
+ * @returns {string}
+ * The validation error at this time
+ */
+ getValidationError: function() {
+ return this.validationError || '';
+ },
+
/**
* Force validation of the current input value.
*
this.node.addEventListener('validation-success', L.bind(function(ev) {
this.validState = true;
+ this.validationError = '';
}, this));
this.node.addEventListener('validation-failure', L.bind(function(ev) {
this.validState = false;
+ this.validationError = ev.detail.message;
}, this));
},