diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 3c967e951..c1b076932 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -10,6 +10,7 @@ **Enhancements** - **Search** - Adds disabled variation **Thanks @prudho** #6225 +- **Form Validation** - Form prompt can now be returned by a function **Thanks @xDaizu** #6016 #3864 **Bugs** - **Dropdown** - Fixed `onChange` missing `text` from callback when dropdown is set to `action: 'select'` #4183 #4510 diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index 6c0d0172b..7b2115ac6 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -435,7 +435,9 @@ $.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 = $.isFunction(rule.prompt) + ? rule.prompt() + : rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule, requiresValue = (prompt.search('{value}') !== -1), requiresName = (prompt.search('{name}') !== -1), $label,