Semantic-Org/Semantic-UI · warning

cannot be set to exactly

Error message

{name} cannot be set to exactly "{ruleValue}"

What it means

Default prompt for the Semantic UI Form `notExactly` rule (settings.rules.notExactly, form.js:1453). Requires the value to differ from the forbidden `{ruleValue}` using case-SENSITIVE comparison. Shown when the value exactly equals the forbidden string.

Solutions

  1. Change the value so it is not the exact forbidden string.
  2. If all cases should be blocked, use the `not` rule.
  3. Add a custom `prompt`.

Example fix

// before
rules: [{ type: 'notExactly[admin]' }]

// after
rules: [{ type: 'notExactly[admin]', prompt: 'Value cannot be "admin"' }]
Defensive patterns

Strategy: validation

Validate before calling

const blocked = 'admin';
if ($field.val() === blocked) { /* warn */ }

Type guard

const isForbiddenExact = (v, t) => v === t;

Prevention

When it happens

Trigger: `{type:'notExactly[admin]'}` with input `admin` (matches exactly → fails); `Admin` would pass.

Common situations: Blocking an exact reserved value while allowing case variants, or the inverse expectation where users think all cases are blocked.

Related errors


AI-assisted analysis of Semantic-Org/Semantic-UI@597843ab84 (2026-08-13). Data as JSON: /api/errors/4b1c73ec515d3a5b. Report an issue: GitHub.

Appendix: source

Thrown at src/definitions/behaviors/form.js:1265

  text: {
    unspecifiedRule  : 'Please enter a valid value',
    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"]',

View on GitHub (pinned to 597843ab84)