Semantic-Org/Semantic-UI · warning
{name} must have a different value than {ruleValue} field
Error message
{name} must have a different value than {ruleValue} field What it means
Default prompt for the Semantic UI Form `different` rule (settings.rules.different, form.js:1542). Requires the field value to DIFFER from another field's value (located the same way as `match`: data-validate → id → name). Stringified strict inequality. Returns FALSE (failing) when the target field is missing, so a bad identifier makes the field 'not different enough' and shows the prompt.
Source
Thrown at src/definitions/behaviors/form.js:1275
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',
input : 'input',
message : '.error.message',
prompt : '.prompt.label',
radio : 'input[type="radio"]',
reset : '.reset:not([type="reset"])',
submit : '.submit:not([type="submit"])',
uiCheckbox : '.ui.checkbox',View on GitHub (pinned to 597843ab84)
Solutions
- Change the value so it differs from the referenced field.
- Ensure the identifier resolves via `data-validate`/`id`/`name` on the other field.
- Use `data-validate` to disambiguate when id and name differ.
- Add a custom `prompt`.
Example fix
// before
rules: [{ type: 'different[current-password]' }]
// after
// <input data-validate="current-password">
rules: [{ type: 'different[current-password]', prompt: 'New password must differ from your current one' }] Defensive patterns
Strategy: validation
Validate before calling
function resolveField(id) {
return $('[data-validate="'+id+'"]').val() ?? $('#'+id).val() ?? $('[name="'+id+'"]').val();
}
const other = resolveField('current-password');
if (other === undefined || String($field.val()) === String(other)) { /* warn */ } Type guard
const targetFieldExists = (id) => $('[data-validate="'+id+'"]').length || $('#'+id).length || $('[name="'+id+'"]').length; Prevention
- Use data-validate to locate the comparison field reliably.
- Remember a missing target makes the rule fail (returns false).
- Provide an explicit prompt describing the constraint.
When it happens
Trigger: `{type:'different[new-password]'}` where the new password field equals the current field, OR the identifier does not resolve to any field (target missing → returns false → prompt shown).
Common situations: Forcing a new password to differ from the old one; username vs password; identifier typos causing spurious failures.
Related errors
- {name} must match {ruleValue} field
- {name} must be a valid url
- {name} is not formatted correctly
- {name} must be an integer
- {name} must be a decimal number
AI-assisted analysis of Semantic-Org/Semantic-UI@597843ab84 (2026-08-13).
Data as JSON: /api/errors/b2bef44286e05f66.
Report an issue: GitHub.