Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

simple checkbox

Open
#206 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js
Domain
backend

Research direction

Start by comparing the string/checkbox and array/multipleCheckbox widget implementations shown in the issue. Trace how each renders the input and its value, then verify that a single checkbox can retain the configured value without adding the unwanted fieldset wrapper.

Written by the indexing model from the issue text.

Description

I am trying to get a simple single checkbox to work. I can't get the value to work. The two closest approaches are have found are array/multipleCheckbox and string/checkbox. However, neither is quite what I want. Here is the javascript:

    blue: fields.array({
        choices: { one: 'item 1' },
        widget: widgets.multipleCheckbox()
    }),
    green: fields.string({
        value: 'abc',
        widget: widgets.checkbox()
    }),

and the resulting HTML:

<div class="field">
    <fieldset>
        <legend>Blue</legend>
        <input type="checkbox" name="blue" id="id_blue_one" value="one" />
        <label for="id_blue_one">
            item 1
        </label>
    </fieldset>
</div>
<div class="field">
    <label for="id_green">Green</label>
    <input type="checkbox" name="green" id="id_green" value="on" />
</div>

Using the array/multipleCheckbox I actually get the <input> code I want. It has the correctly set value, but it is wrapped in an unwanted <fieldset>.

The other version using string/checkbox doesn't have the <fieldset> but the value incorrectly set to "on".

Dominant language
JavaScript
Stars
1k
Forks
161
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from caolan/forms

All issues in caolan/forms

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.