Semantic-Org/Semantic-UI · warning

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

Error message

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

What it means

Default prompt for the Semantic UI Form `not` rule (settings.rules.not, form.js:1440). Requires the value to be DIFFERENT from the forbidden `{ruleValue}` (case-insensitive). Shown when the value equals the forbidden value.

Source

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

  },

  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 : {

View on GitHub (pinned to 597843ab84)

Solutions

  1. Choose a value different from the forbidden one.
  2. If case-sensitive blocking is intended, use `notExactly`.
  3. Provide a custom `prompt` explaining what is blocked.

Example fix

// before
rules: [{ type: 'not[password]' }]  // input 'PASSWORD' fails (case-insensitive)

// after
rules: [{ type: 'notExactly[password]', prompt: 'Cannot use "password" as your password' }]
Defensive patterns

Strategy: validation

Validate before calling

const blocked = 'password';
if (($field.val() || '').toLowerCase() === blocked.toLowerCase()) { /* warn: forbidden */ }

Type guard

const isForbiddenCI = (v, t) => String(v).toLowerCase() === String(t).toLowerCase();

Prevention

When it happens

Trigger: `{type:'not[password]'}` with input `password`; `{type:'not[admin]'}` with input `ADMIN` (case-insensitive, so it matches and fails).

Common situations: Preventing a new password equal to a username/common word, or blocking a reserved value. Case-insensitivity can surprise users who expect `Admin` to be allowed when `admin` is forbidden.

Related errors


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