{"record":{"id":"1db7609625e82c03","repo":"Semantic-Org/Semantic-UI","slug":"name-cannot-contain-rulevalue","errorCode":null,"errorMessage":"{name} cannot contain  \"{ruleValue}\"","messagePattern":"(.+?) cannot contain  \"(.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/definitions/behaviors/form.js","lineNumber":1268,"sourceCode":"    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',\n    field      : 'input, textarea, select',\n    group      : '.field',","sourceCodeStart":1250,"sourceCodeEnd":1286,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/behaviors/form.js#L1250-L1286","documentation":"Default prompt for the Semantic UI Form `doesntContain` rule (settings.rules.doesntContain, form.js:1472). Here the prompt key (form.js:1268) and the rule function name MATCH, so it resolves correctly. Requires the value to NOT contain `{ruleValue}` (case-insensitive substring). Note the literal message contains a DOUBLE space (`'cannot contain  \"'`) — a typo in the source that surfaces verbatim to users.","triggerScenarios":"`{type:'doesntContain[spam]'}` with input `spam@example.com` or `This is spam` → contains `spam` case-insensitively → prompt shown (with the double space).","commonSituations":"Blocking banned words in comments/usernames; users noticing the odd double-space rendering in the UI.","solutions":["Remove the forbidden substring from the value.","If case-sensitivity is intended, use `doesntContainExactly`.","Override the prompt to fix the double-space typo: `{type:'doesntContain[spam]', prompt:'Value cannot contain \"spam\"'}`."],"exampleFix":"// before - default ships with a double-space typo\nrules: [{ type: 'doesntContain[spam]' }]  // renders '... cannot contain  \"spam\"'\n\n// after - corrected custom prompt\nrules: [{ type: 'doesntContain[spam]', prompt: 'Value cannot contain \"spam\"' }]","handlingStrategy":"validation","validationCode":"const banned = 'spam';\nif (($field.val() || '').toLowerCase().indexOf(banned.toLowerCase()) !== -1) { /* warn */ }","typeGuard":"const containsBannedCI = (v, t) => String(v).toLowerCase().indexOf(String(t).toLowerCase()) !== -1;","tryCatchPattern":null,"preventionTips":["Override the prompt to fix the source double-space typo.","Use doesntContainExactly for case-sensitive bans.","Normalize input case before checking if a case-insensitive ban is intended."],"tags":["semantic-ui","form-validation","substring","typo","client-side"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}