Skip to main content

JavaScript frameworks

Keep the form semantics​

Wrap controls in a form, associate a label with every field, and handle the submit event instead of the button click. Native markup works for static and hydrated pages. A controlled form can add local state for pending, server error, and success.

Choose where to send​

A directly submitted browser form is the simpler path for static exports. An existing framework server can validate or enrich fields before forwarding them. A server-side request has no browser origin, so review form domain settings and use a dedicated form if needed.

Keep framework data private​

Use the public form key in browser code. Keep webhook credentials, CAPTCHA secrets, and any credentials for downstream tools in server-side settings.