{"record":{"id":"0cc3c9f1bdbb62b2","repo":"sveltejs/kit","slug":"type-radio-radio-checkbox-array-i","errorCode":null,"errorMessage":"${type === 'radio' ? 'Radio' : 'Checkbox array'} inputs must have a value","messagePattern":"(.+?) inputs must have a value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/runtime/form-utils.js","lineNumber":845,"sourceCode":"\t\t\t\tif (type === 'select' || type === 'select multiple') {\n\t\t\t\t\treturn add_props(base_props, {\n\t\t\t\t\t\tmultiple: is_array,\n\t\t\t\t\t\tvalue: () => {\n\t\t\t\t\t\t\tconst value = read(input_value);\n\t\t\t\t\t\t\t// copied, so the state array can't be edited through the props\n\t\t\t\t\t\t\treturn Array.isArray(value) ? [...value] : value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Handle checkbox inputs\n\t\t\t\tif (type === 'checkbox' || type === 'radio') {\n\t\t\t\t\t// radio and checkbox array inputs take their option as the second argument\n\t\t\t\t\t// and whether it is checked as the third, a single checkbox only the latter\n\t\t\t\t\tconst has_option = type === 'radio' || is_array;\n\n\t\t\t\t\tif (DEV && has_option && !input_value) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`${type === 'radio' ? 'Radio' : 'Checkbox array'} inputs must have a value`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (has_option) {\n\t\t\t\t\t\tbase_props.value = input_value ?? 'on';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchecked = /** @type {boolean | undefined} */ (input_value);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn add_props(base_props, {\n\t\t\t\t\t\tdefaultChecked: checked,\n\t\t\t\t\t\tchecked: () => {\n\t\t\t\t\t\t\tconst value = read();\n\t\t\t\t\t\t\tif (value == null) return read(checked);\n\t\t\t\t\t\t\tif (type === 'radio') return value === input_value;\n\t\t\t\t\t\t\tif (is_array) return /** @type {unknown[]} */ (value).includes(input_value);\n\t\t\t\t\t\t\treturn value;","sourceCodeStart":827,"sourceCodeEnd":863,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/form-utils.js#L827-L863","documentation":"Dev-time validation in the form element prop builder: radio buttons and checkbox arrays encode their choice as the input's value attribute, so it cannot be omitted. This fires when creating a radio or multi-checkbox input through the remote form machinery without providing the option value as the second argument.","triggerScenarios":"Thrown at packages/kit/src/runtime/form-utils.js:845 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the option value: field('radio', 'choice', { value: 'choice' }) or pass it as the input's second argument","Use a plain checkbox (single boolean) if no per-item value is needed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}