Semantic-Org/Semantic-UI · warning
{name} must be checked
Error message
{name} must be checked What it means
This is a validation prompt used by Semantic UI's Form module. It is displayed when a checkbox or radio input with the 'checked' validation rule fails because the element is not in a checked state. The prompt is retrieved via module.get.prompt() (form.js:440-442) with {name} replaced by the field's label. The 'checked' rule function (form.js:1342-1343) checks $(this).filter(':checked').length > 0.
Source
Thrown at src/definitions/behaviors/form.js:1255
htmlID : /^[a-zA-Z][\w:.-]*$/g,
bracket : /\[(.*)\]/i,
decimal : /^\d+\.?\d*$/,
email : /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
escape : /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
flags : /^\/(.*)\/(.*)?/,
integer : /^\-?\d+$/,
number : /^\-?\d*(\.\d+)?$/,
url : /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i
},
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',View on GitHub (pinned to 597843ab84)
Solutions
- Ensure the user checks the required checkbox/radio (this prompt IS the solution for unchecked required fields).
- Customize the prompt: settings.prompt.checked = 'Please accept the {name} to continue'.
- If using Semantic UI's checkbox module, ensure the underlying input is properly synced via $('.ui.checkbox').checkbox().
- If the field is optional, remove the 'checked' rule.
Example fix
// before
$('.ui.form').form({
agree: { rules: [{ type: 'checked', prompt: '{name} must be checked' }] }
// generic prompt
});
// after
$('.ui.form').form({
agree: {
identifier: 'agree',
rules: [{ type: 'checked', prompt: 'Please accept the Terms of Service' }]
}
}); Defensive patterns
Strategy: validation
Validate before calling
// Pre-validate checkbox/radio state before form submission
function validateChecked($form) {
var valid = true;
$form.find('input[data-validate="checked"]').each(function() {
if (!$(this).is(':checked')) {
valid = false;
console.warn('Checkbox not checked:', $(this).attr('name'));
}
});
return valid;
} Type guard
// Check if a checkbox or radio is checked
function isChecked($field) {
return $field.is(':checked');
} Prevention
- Ensure Semantic UI's checkbox module is properly synced with the underlying input.
- Use clear, specific prompt messages for required checkboxes.
- Consider using the 'exactChecked' or 'different' rules for more complex checkbox validation.
When it happens
Trigger: A checkbox or radio field is configured with rules: [{ type: 'checked' }] and the user submits the form without checking it. The validate.rule() function calls the 'checked' rule which filters the jQuery element set for :checked; if none are checked, validation fails and this prompt is shown.
Common situations: Terms-of-service or consent checkboxes left unchecked. Required radio button groups (e.g., gender, payment method) with no selection. Checkbox arrays where at least one must be checked. Dynamically rendered checkbox lists where the user misses one. Checkbox widgets wrapped by Semantic UI's checkbox module where the underlying input state doesn't sync.
Related errors
- {name} must have a value
- {name} must be a valid e-mail
- Progress value is non numeric
- Console cannot be restored, most likely it was overwritten o
- The method you called is not defined.
AI-assisted analysis of Semantic-Org/Semantic-UI@597843ab84 (2026-08-13).
Data as JSON: /api/errors/9665170fa3dde913.
Report an issue: GitHub.