diff --git a/ignite-html-validate.js b/ignite-html-validate.js
index a0d4eba..e08a077 100644
--- a/ignite-html-validate.js
+++ b/ignite-html-validate.js
@@ -22,6 +22,8 @@ function notify(target, type, msg, duration) {
color = "#10c469";
}
+ target.scrollIntoView({ behavior: "smooth" });
+
if (target._validation && target._validation.isConnected) {
target._validation.remove();
}
@@ -263,6 +265,20 @@ IgniteTemplate.prototype.validateMax = function (max, msg) {
});
}
+/**
+ * Validates an input to make sure it it's value is not the given value.
+ * @param {Any} expected The value the input cannot have in order to be considered valid.
+ * @param {string|Function|IgniteProperty} msg The message to display when the input length is too long. If null a deafult one will show.
+ * @returns {IgniteTemplate} This ignite template.
+ */
+IgniteTemplate.prototype.validateNot = function(expected, msg) {
+ return this.validate((value, error) => {
+ if (!value || value == expected) {
+ return error(msg ? msg : `Input cannot be ${expected}.`);
+ }
+ });
+}
+
/**
* Validates an input to make sure it includes a string.
* @param {string} str The string that the input must include.