{"record":{"id":"6cd9743d53431553","repo":"Semantic-Org/Semantic-UI","slug":"name-must-be-exactly-rulevalue-characters","errorCode":null,"errorMessage":"{name} must be exactly {ruleValue} characters","messagePattern":"(.+?) must be exactly (.+?) characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/definitions/behaviors/form.js","lineNumber":1272,"sourceCode":"    empty                : '{name} must have a value',\n    checked              : '{name} must be checked',\n    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\"]',","sourceCodeStart":1254,"sourceCodeEnd":1290,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/behaviors/form.js#L1254-L1290","documentation":"Default prompt for the Semantic UI Form `exactLength` rule (settings.rules.exactLength, form.js:1502). Shown when `value.length != requiredLength`. Guarded against undefined value (returns false).","triggerScenarios":"`{type:'exactLength[6]'}` with input `12345` (5) or `1234567` (7). Common for OTP/pin/code fields.","commonSituations":"OTP codes, postal codes, serial numbers; off-by-one in the configured length.","solutions":["Enter exactly the required number of characters.","Double-check the configured length matches the spec.","Add a custom `prompt` stating the exact count."],"exampleFix":"// before\nrules: [{ type: 'exactLength[6]' }]\n\n// after\nrules: [{ type: 'exactLength[6]', prompt: 'Enter the 6-digit code' }]","handlingStrategy":"validation","validationCode":"const n = 6;\nif (($field.val() || '').length !== n) { /* warn */ }","typeGuard":"const isExactLength = (v, n) => String(v).length === n;","tryCatchPattern":null,"preventionTips":["Set maxlength on the input to match exactLength to prevent overrun.","Verify the configured length against the spec.","Provide an explicit prompt with the required count."],"tags":["semantic-ui","form-validation","length","exact","client-side"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}