Form events in JavaScript
Run your own code when a form is submitted, succeeds or fails, with the form data and the server response.
Each event receives the form (id, fields, FormData, page path, target element) and, for success and fail, the server response.
How it works
- Registered event ids (group Forms): forms.submit, forms.success, forms.fail; the Form element exposes dh.submit, inputs dh.input and dh.change.
- form object: id, fields (name -> value), data (FormData), url (pathname), event, target.
- A submit listener may set form.id to null to stop the send.
- Submit JS helper: admin.forms.Fn('submit', id, FormData, url).success(fn).fail(fn).
When to use it
- Fire an analytics conversion on success
- Show a custom toast on failure
- Copy the submitted email to another script
Limitations
- Client-side only; reading stored submissions needs the dashboard, Studio, the API or MCP.
Availability
- Works in Designer.
Related features.
Custom success state
Replace the form with your own designed success or error block, or show a custom text message.
Form submissions API
Read a form's submissions as JSON through a documented endpoint, up to 1000 per page.
Custom HTML forms
Build a form from native form, input, textarea, select and label elements and connect it to a Divhunt form for storage and delivery.
Browse other features
Designer
Bring your ideas to life with our visual website builder. Drag and drop with ease, or dive into coding when needed.
→AI Studio
Describe it and AI builds it. Every change lands in the same project you can open in the Designer.
→MCP
Connect Claude Code, Cursor or any MCP client and build whole sites with your own agent.
→CMS
Create, organize, and manage your dynamic content with the maximum freedom and flexibility of our visual CMS.
→SEO
Divhunt delivers ultra-fast & structured sites that are good for ranking by default, while offering complete control for customization.
→REST API
Easily link to any REST API endpoint with instant preview and expand your site’s functionality smoother than ever before.
→Plugins
Divhunt offers an open platform for creating plugins to upgrade features, add new capabilities, and simplify building better sites.
→Localization
Localize everything from static pages and CMS content to URLs and metadata, in up to 15 languages with no add-on.
→Interactions
Visually create animations and interactions with a simple, intuitive timeline. Build smooth, engaging experiences without code.
→Custom Files
Manage JS and CSS files with a structure developers love, combining folders and clean organization.
→Memberships
Create plans, decide who sees what and connect it all to your CMS. Build courses, communities or client portals.
→