Skip to content

SubmitoAJAX forms for plain HTML

No framework, no runtime dependencies, and ready for AI coding agents.

bash
npm install submito
npx submito skill

Zero dependenciesTypeScript typesAgent skill includedMIT

How it works

Write HTML.
Get a working form.

  1. Rules come from your markup. required, type, minlength and pattern are checked live and shown inline.
  2. One call sends it. FormData over fetch, with a loading state and a double-submit guard.
  3. The reply drives the UI. Field errors land next to their inputs, and the message opens a dialog.
html
<form id="contact" action="/api/contact" method="post">
  <input name="email" type="email" required />
  <textarea name="message" required minlength="10"></textarea>
  <button>Send</button>
</form>

<script type="module">
  import submito from 'submito';
  submito.newForm({ form: '#contact' });
</script>
js
app.post('/api/contact', upload.none(), (req, res) => {
  if (!isEmail(req.body.email)) {
    return res.status(422).json({
      message: 'Please fix the highlighted fields.',
      errors: [{ name: 'email', message: 'Enter a valid email.' }],
    });
  }
  res.json({ status: 'success', message: 'Thanks! We will reply soon.' });
});
js
const form = document.querySelector('#contact');

form.addEventListener('submito:success', (event) => {
  const { response, formData } = event.detail;
  console.log(response.message, formData.get('email'));
});

Features

Small core, optional extras.

For AI agents

Give your coding agent the manual.

One entry point, rules in plain HTML attributes and one typed response leave agents little to guess. The skill and the plain-text docs cover the rest.

AI & agents →

Released under the MIT License.