PHPMaker v2022.3.0.I got Javascript error message as follows if the field uses Checkbox control and it is setup as mandatory (Required option is enabled from Fields setup → Edit Tag pane → Validation).
Uncaught (in promise) TypeError: this._element.closest is not a function
at e.t.updateFeedback (ew.js:1596)
at e.t.validate (ew.js:1566)
at t.a.validateFields (ew.js:1981)
at t.a.validate (ew.js:2037)
at t.canSubmit (ew.js:1015)
at HTMLButtonElement.v (ew.js:6543)
at HTMLButtonElement.dispatch (jquery-3.6.0.min.js:2)
at HTMLButtonElement.v.handle (jquery-3.6.0.min.js:2)
To reprodce this issue, please do the following steps:
- Open demo2022 project, go to products table, and make sure it has master/detail relationship with categories table as its master table,
- Make sure the Discontinued field has been setup as Required and it uses Checkbox control with user values contains 1 for Yes, and 0 for No,
- Make sure you have already enabled Preview extension, by enabling UseModalLinks for products table,
- Re-generate ALL the script files, and then go to Categories List page of generated web application,
- Expand the preview row, and then please try to edit one of the Product record, and in the Edit form, make sure the Discontinued field is not selected (let it blank)
- Click on Save button, then you will see the issue in Console section of browser (F12), the Javascript error message above will appear, and the submit process will be suspended.
Please note that this error will not be happened if the Discontinued field is selected (marked as checked).