{"record":{"id":"f7c29f95fbcb9d16","repo":"Semantic-Org/Semantic-UI","slug":"name-must-contain-rulevalue","errorCode":null,"errorMessage":"{name} must contain \"{ruleValue}\"","messagePattern":"(.+?) must contain \"(.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/definitions/behaviors/form.js","lineNumber":1266,"sourceCode":"  text: {\n    unspecifiedRule  : 'Please enter a valid value',\n    unspecifiedField : 'This field'\n  },\n\n  prompt: {\n    empty                : '{name} must have a value',\n    checked              : '{name} must be checked',\n    email                : '{name} must be a valid e-mail',\n    url                  : '{name} must be a valid url',\n    regExp               : '{name} is not formatted correctly',\n    integer              : '{name} must be an integer',\n    decimal              : '{name} must be a decimal number',\n    number               : '{name} must be set to a number',\n    is                   : '{name} must be \"{ruleValue}\"',\n    isExactly            : '{name} must be exactly \"{ruleValue}\"',\n    not                  : '{name} cannot be set to \"{ruleValue}\"',\n    notExactly           : '{name} cannot be set to exactly \"{ruleValue}\"',\n    contain              : '{name} must contain \"{ruleValue}\"',\n    containExactly       : '{name} must contain exactly \"{ruleValue}\"',\n    doesntContain        : '{name} cannot contain  \"{ruleValue}\"',\n    doesntContainExactly : '{name} cannot contain exactly \"{ruleValue}\"',\n    minLength            : '{name} must be at least {ruleValue} characters',\n    length               : '{name} must be at least {ruleValue} characters',\n    exactLength          : '{name} must be exactly {ruleValue} characters',\n    maxLength            : '{name} cannot be longer than {ruleValue} characters',\n    match                : '{name} must match {ruleValue} field',\n    different            : '{name} must have a different value than {ruleValue} field',\n    creditCard           : '{name} must be a valid credit card number',\n    minCount             : '{name} must have at least {ruleValue} choices',\n    exactCount           : '{name} must have exactly {ruleValue} choices',\n    maxCount             : '{name} must have {ruleValue} or less choices'\n  },\n\n  selector : {\n    checkbox   : 'input[type=\"checkbox\"], input[type=\"radio\"]',\n    clear      : '.clear',","sourceCodeStart":1248,"sourceCodeEnd":1284,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/behaviors/form.js#L1248-L1284","documentation":"Default prompt keyed under `contain` in settings.prompt (form.js:1266). IMPORTANT quirk: the rule FUNCTION is named `contains` (form.js:1458) — there is no `settings.rules.contain`. Because `module.get.ruleName` (form.js:395) returns the rule type verbatim, using `{type:'contain[...]'}` yields ruleName `contain`, `settings.rules['contain']` is undefined, and `module.error(error.noRule)` fires (form.js:1024-1026). The intended usage is `{type:'contains[...]'}`, but then the prompt lookup `settings.prompt['contains']` is undefined and falls back to `unspecifiedRule`. So this `contain` message is effectively unreachable unless you set an explicit `rule.prompt`.","triggerScenarios":"Intended: `{type:'contains[abc]'}` with input lacking `abc` (case-insensitive substring). Actual: either a `noRule` console error (if you wrote `contain`), or the generic 'Please enter a valid value' fallback (because the prompt key does not match the function name).","commonSituations":"Developers following docs that mention `contain` and finding the message never appears, or seeing `noRule` errors in the console.","solutions":["Use the correct rule type `contains[...]` AND supply an explicit `prompt`, since the default `contain` key is never matched.","Add the missing alias globally: `$.fn.form.settings.rules.contain = $.fn.form.settings.rules.contains; $.fn.form.settings.prompt.contains = $.fn.form.settings.prompt.contain;`.","If you only need the message, set `rules:[{type:'contains[abc]', prompt:'Must contain \"abc\"'}]`."],"exampleFix":"// before - prompt key 'contain' never resolves\nrules: [{ type: 'contains[abc]' }]  // shows 'Please enter a valid value'\n\n// after - explicit prompt makes the message correct\nrules: [{ type: 'contains[abc]', prompt: 'Value must contain \"abc\"' }]","handlingStrategy":"validation","validationCode":"const needle = 'abc';\nif (($field.val() || '').toLowerCase().indexOf(needle.toLowerCase()) === -1) { /* warn */ }","typeGuard":"const usesContainsRule = (rule) => /^contains(\\[.*\\])?$/.test(rule.type || '');","tryCatchPattern":null,"preventionTips":["Use type 'contains[...]' (not 'contain') and set an explicit prompt — the default 'contain' key is never matched.","Register aliases once at startup if you prefer the 'contain' spelling.","Test that the expected message actually renders."],"tags":["semantic-ui","form-validation","substring","naming-mismatch","client-side"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}