simple checkbox
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from caolan/forms
-
Feature Requests Needs More Info
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Cut a new release?Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Feature Requests pull request wanted
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Feature Requests
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CircuitVerse/CircuitVerse#7967 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CopilotKit/aimock#491 ·
Maintainers usually reply within 1 day
-
cvss-severity:high devguard l3montree-cybersecurity/.../devguard-documentation pkg:devguard/l3montree-c.../devguard-documentation risk:low state:open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
l3montree-dev/devguard-documentation#338 · 1 comment ·
-
bug runtime spec compliance
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
frostney/GocciaScript#1413 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
keyxmakerx/Chronicle#967 ·
Maintainers usually reply within 1 day