Semantic-Org/Semantic-UI · warning
{name} cannot contain "{ruleValue}"
Error message
{name} cannot contain "{ruleValue}" What it means
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.
Source
Thrown at src/definitions/behaviors/form.js:1268
unspecifiedField : 'This field'
},
prompt: {
empty : '{name} must have a value',
checked : '{name} must be checked',
email : '{name} must be a valid e-mail',
url : '{name} must be a valid url',
regExp : '{name} is not formatted correctly',
integer : '{name} must be an integer',
decimal : '{name} must be a decimal number',
number : '{name} must be set to a number',
is : '{name} must be "{ruleValue}"',
isExactly : '{name} must be exactly "{ruleValue}"',
not : '{name} cannot be set to "{ruleValue}"',
notExactly : '{name} cannot be set to exactly "{ruleValue}"',
contain : '{name} must contain "{ruleValue}"',
containExactly : '{name} must contain exactly "{ruleValue}"',
doesntContain : '{name} cannot contain "{ruleValue}"',
doesntContainExactly : '{name} cannot contain exactly "{ruleValue}"',
minLength : '{name} must be at least {ruleValue} characters',
length : '{name} must be at least {ruleValue} characters',
exactLength : '{name} must be exactly {ruleValue} characters',
maxLength : '{name} cannot be longer than {ruleValue} characters',
match : '{name} must match {ruleValue} field',
different : '{name} must have a different value than {ruleValue} field',
creditCard : '{name} must be a valid credit card number',
minCount : '{name} must have at least {ruleValue} choices',
exactCount : '{name} must have exactly {ruleValue} choices',
maxCount : '{name} must have {ruleValue} or less choices'
},
selector : {
checkbox : 'input[type="checkbox"], input[type="radio"]',
clear : '.clear',
field : 'input, textarea, select',
group : '.field',View on GitHub (pinned to 597843ab84)
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"'}`.
Example fix
// before - default ships with a double-space typo
rules: [{ type: 'doesntContain[spam]' }] // renders '... cannot contain "spam"'
// after - corrected custom prompt
rules: [{ type: 'doesntContain[spam]', prompt: 'Value cannot contain "spam"' }] Defensive patterns
Strategy: validation
Validate before calling
const banned = 'spam';
if (($field.val() || '').toLowerCase().indexOf(banned.toLowerCase()) !== -1) { /* warn */ } Type guard
const containsBannedCI = (v, t) => String(v).toLowerCase().indexOf(String(t).toLowerCase()) !== -1;
Prevention
- 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.
When it happens
Trigger: `{type:'doesntContain[spam]'}` with input `spam@example.com` or `This is spam` → contains `spam` case-insensitively → prompt shown (with the double space).
Common situations: Blocking banned words in comments/usernames; users noticing the odd double-space rendering in the UI.
Related errors
- {name} must contain "{ruleValue}"
- {name} must contain exactly "{ruleValue}"
- {name} cannot contain exactly "{ruleValue}"
- {name} must be a valid url
- {name} is not formatted correctly
AI-assisted analysis of Semantic-Org/Semantic-UI@597843ab84 (2026-08-13).
Data as JSON: /api/errors/1db7609625e82c03.
Report an issue: GitHub.