{"record":{"id":"b69ea2bba42b75d9","repo":"Semantic-Org/Semantic-UI","slug":"name-must-match-rulevalue-field","errorCode":null,"errorMessage":"{name} must match {ruleValue} field","messagePattern":"(.+?) must match (.+?) field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/definitions/behaviors/form.js","lineNumber":1274,"sourceCode":"    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',\n    input      : 'input',\n    message    : '.error.message',\n    prompt     : '.prompt.label',\n    radio      : 'input[type=\"radio\"]',\n    reset      : '.reset:not([type=\"reset\"])',\n    submit     : '.submit:not([type=\"submit\"])',","sourceCodeStart":1256,"sourceCodeEnd":1292,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/behaviors/form.js#L1256-L1292","documentation":"Default prompt for the Semantic UI Form `match` rule (settings.rules.match, form.js:1518). Requires the field value to equal the value of ANOTHER field, located by `data-validate`, then `#id`, then `[name=]`, then `[name=[]]` (form.js:1523-1534). Comparison is stringified and strict-`==`. The rule returns FALSE (failing) when the target field cannot be found, so a misnamed identifier produces this prompt.","triggerScenarios":"`{type:'match[password-confirm]'}` where the confirm field's value differs, OR the identifier `password-confirm` does not match any `data-validate`/id/name in the form (target missing → returns false → prompt shown).","commonSituations":"Password/confirm-password pairs; the target field uses a different id vs name; the bracket identifier has a typo or trailing space.","solutions":["Make the two field values identical.","Ensure the bracket identifier matches the other field's `data-validate`, `id`, or `name` attribute (checked in that order).","Prefer using `data-validate=\"identifier\"` on the target to avoid id/name ambiguity.","Add a custom `prompt` naming the field to match."],"exampleFix":"// before - target has id 'passwordConfirm' but rule references 'password-confirm'\nrules: [{ type: 'match[password-confirm]' }]\n\n// after - align identifiers via data-validate\n// <input data-validate=\"password-confirm\" id=\"passwordConfirm\">\nrules: [{ type: 'match[password-confirm]', prompt: 'Passwords must match' }]","handlingStrategy":"validation","validationCode":"function resolveField(id) {\n  return $('[data-validate=\"'+id+'\"]').val() ?? $('#'+id).val() ?? $('[name=\"'+id+'\"]').val();\n}\nconst other = resolveField('password-confirm');\nif (other === undefined || String($field.val()) !== String(other)) { /* warn */ }","typeGuard":"const targetFieldExists = (id) => $('[data-validate=\"'+id+'\"]').length || $('#'+id).length || $('[name=\"'+id+'\"]').length;","tryCatchPattern":null,"preventionTips":["Add data-validate=\"<id>\" to the target field to disambiguate from id/name.","Double-check the bracket identifier spelling.","Set an explicit prompt naming the field to match."],"tags":["semantic-ui","form-validation","cross-field","match","client-side"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}