User tests: Successful: Unsuccessful:
Fixes #31194.
Fixes validation of required checkboxes.
node build/build.js --compile-js required.
Add a checkboxes field with required attribute to some form. E.g. edit plugins/editors/codemirror/codemirror.xml to add required="true" attribute to fullScreenMod field:
<field
name="fullScreenMod"
type="checkboxes"
label="PLG_CODEMIRROR_FIELD_FULLSCREEN_MOD_LABEL"
required="true"
>
<option value="Shift">PLG_CODEMIRROR_FIELD_VALUE_FULLSCREEN_MOD_SHIFT</option>
<option value="Cmd">PLG_CODEMIRROR_FIELD_VALUE_FULLSCREEN_MOD_CMD</option>
<option value="Ctrl">PLG_CODEMIRROR_FIELD_VALUE_FULLSCREEN_MOD_CTRL</option>
<option value="Alt">PLG_CODEMIRROR_FIELD_VALUE_FULLSCREEN_MOD_ALT</option>
</field>
Edit Editors - CodeMirror plugin.
Try to save it with no options selected in Toggle Fullscreen Modifier field.
Form is submitted.
Form is not submitted, message is shown:
Error
The form cannot be submitted as it's missing required data.
Please correct the marked fields and try again.
No.
| Status | New | ⇒ | Pending |
| Category | ⇒ | JavaScript Repository NPM Change |
| Labels |
Added:
NPM Resource Changed
?
|
||
The validation works. Only inline message is not shown because there's nowhere to show it. Open a new issue if you want.
I have tested this item
| Status | Pending | ⇒ | Ready to Commit |
RTC
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-10-27 13:12:47 |
| Closed_By | ⇒ | rdeutz | |
| Labels |
Added:
?
|
||
I have tested this item✅ successfully on 66c5aac
@SharkyKZ this works fine, but I noticed another general problem.
The js validation works only by renderField() not by only ->getInput()
Because its placed at the label and if you use only ->getInput() without ->getLabel() the validation works not.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31196.