From 4edeae45f649afab19b80f29ae5d23d31af6c4f8 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Fri, 12 Jan 2024 17:53:02 +0100 Subject: [PATCH] feat(formvalidation): support prompt functions for settings value --- src/definitions/behaviors/form.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index a7ffeae800..a2b96e3e8f 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -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,