#6009 closed enhancement (patchwelcome)
CheckBox: support required=true
Reported by: | nonken | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 2.0 |
Component: | Dijit - Form | Version: | 1.0 |
Keywords: | CheckBox, required | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
In some use-cases you want checkboxes to be required to be checked. Typical example is "do you agree to these license terms?" in an install wizard.
Also wondering about radio field. Are there cases where you first set no checked value and then have a required one?
Change History (19)
comment:1 Changed 13 years ago by
Cc: | [email protected]… added |
---|---|
Component: | Dijit → Dojox |
Description: | modified (diff) |
Milestone: | → 1.2 |
Owner: | set to Adam Peller |
Summary: | dijitCheckBox, isValid support → CheckBox: support required=true |
comment:2 Changed 13 years ago by
Component: | Dojox → DojoX Form |
---|---|
Owner: | changed from Adam Peller to dante |
comment:3 Changed 13 years ago by
Cc: | nathan added; [email protected]… removed |
---|
comment:4 Changed 13 years ago by
I'd keep it in dijit since this functionality is quite essential for form handling. The above use cases appear on almost every site which deals with usersignups, sales or other e-commerce
comment:5 Changed 13 years ago by
I tend to agree - I don't think this is so much a "new" widget as a mechanism for adding support for isValid and validate to the existing widget.
comment:6 Changed 13 years ago by
comment:7 Changed 13 years ago by
Cc: | nathan removed |
---|---|
Description: | modified (diff) |
Owner: | changed from dante to Nathan Toone |
comment:8 Changed 13 years ago by
Owner: | changed from Nathan Toone to nathan |
---|
comment:9 Changed 13 years ago by
Status: | new → assigned |
---|
comment:10 Changed 13 years ago by
Milestone: | 1.2 → 1.3 |
---|---|
Status: | assigned → new |
comment:11 Changed 13 years ago by
Owner: | changed from nathan to Nathan Toone |
---|
comment:12 Changed 12 years ago by
Milestone: | 1.3 → future |
---|
comment:14 Changed 8 years ago by
Milestone: | future → 1.9 |
---|---|
Owner: | set to wildbill |
Status: | new → assigned |
Is this really not yet supported by dijit/Form?
comment:15 Changed 8 years ago by
Component: | DojoX Form → Dijit - Form |
---|---|
Milestone: | 1.9 → 2.0 |
Owner: | changed from wildbill to Douglas Hays |
The question doesn't really make sense. Widgets support their own "required" flag.
It's not possible to do that for CheckBox etc. in 1.9 given that there's no place for an exclamation mark invalid icon to be displayed as part of the widget, but something to reconsider for 2.0, so leaving this open.
comment:16 Changed 7 years ago by
Owner: | Douglas Hays deleted |
---|---|
Status: | assigned → open |
comment:17 Changed 5 years ago by
Bill, have you addresses this with Delite/Deliteful?? Can we close this out as patchwelcome?
comment:18 Changed 5 years ago by
Resolution: | → patchwelcome |
---|---|
Status: | open → closed |
It's not addressed in deliteful, but we can close as patchwelcome.
comment:19 Changed 4 years ago by
The only problem here is showing a visual indication. Maybe the label should be part of the widget, so you have something to work with? How often do you use a checkbox without a label? Exactly. But wrap it around the checkbox, don't use an extra one. Makes layout much easier and less error prone.
HTML5 forms show a tooltip, pointing at the checkbox btw.
Nonetheless, I think it's worth it to at least support the required
flag along with a validate()
method, so you can at least wrap a Form
widget around the checkboxes, so the form's validate()
method will automatically (the form calls each widget's validate()
method already: https://github.com/dojo/dijit/blob/master/form/_FormMixin.js#L72) consider them during validation. That would at least put them on equal footing with plain HTML form validation, and not make it worse.
Marking for consideration for 1.2. This is probably a dojox.form thing more than a dijit thing? Not sure.