Skip to content

Commit

Permalink
feat(formvalidation): support prompt functions for settings value
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de committed Jan 12, 2024
1 parent e4ff553 commit 4edeae4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,10 @@
ancillary = module.get.ancillaryValue(rule),
$field = module.get.field(field.identifier),
value = $field.val(),
prompt = isFunction(rule.prompt)
? rule.prompt.call($field[0], value)
: rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
promptCheck = rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
prompt = String(isFunction(promptCheck)
? promptCheck.call($field[0], value)
: promptCheck),
requiresValue = prompt.search('{value}') !== -1,
requiresName = prompt.search('{name}') !== -1,
parts,
Expand Down

0 comments on commit 4edeae4

Please sign in to comment.