From 2268c8d96891ac73deac2ff9941fdca7e0be2aaa Mon Sep 17 00:00:00 2001 From: Daniel Parejo Date: Mon, 11 Dec 2017 10:55:47 +0100 Subject: [PATCH] Fix to issue #3864 Allows the validation prompt to also be a function that returns a string, as discussed in [issue #3864](https://github.com/Semantic-Org/Semantic-UI/issues/3864) --- src/definitions/behaviors/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index 7d1dca7898..2a70a0be21 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -354,7 +354,7 @@ $.fn.form = function(parameters) { var ruleName = module.get.ruleName(rule), ancillary = module.get.ancillaryValue(rule), - prompt = rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule, + prompt = (typeof rule.prompt === "function" ? rule.prompt() : rule.prompt) || settings.prompt[ruleName] || settings.text.unspecifiedRule, requiresValue = (prompt.search('{value}') !== -1), requiresName = (prompt.search('{name}') !== -1), $label,