Browse Source

Implement prompt as a function #6016

fix-flex
Jack 6 years ago
parent
commit
9eb4ac3c20
2 changed files with 4 additions and 1 deletions
  1. 1
      RELEASE-NOTES.md
  2. 4
      src/definitions/behaviors/form.js

1
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

4
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,

Loading…
Cancel
Save