htmx ยท console.warn
autoInitForm: no form enhancer registered an...
Printed by htmx, prefixed [lattice], since 1.98.1.
Warnings reference › htmx:form-no-enhancer
- Identifier
htmx:form-no-enhancer- Raised by
- htmx
- Since
- 1.98.1
What happened
The htmx adapter does not inline the form engine, so a [data-lattice-form] element needs an enhancer: one registered with registerForm(), or the script-tag global the form module's UMD build publishes (globalThis.LatticeGridForm.enhanceForm). Neither was present, so the element was left un-enhanced and the server form submitted without client-side validation.
The fix
Load the form module and call registerForm(enhanceForm), or load its UMD build as a <script> tag so globalThis.LatticeGridForm.enhanceForm exists.
The smallest fix
import { registerForm } from '@toclocoinc/lattice-grid/modules/htmx';
import { enhanceForm } from '@toclocoinc/lattice-grid/modules/form';
registerForm(enhanceForm);
Reference
Covered in full at the API reference.