SubmitoAJAX forms for plain HTML
No framework, no runtime dependencies, and ready for AI coding agents.
No framework, no runtime dependencies, and ready for AI coding agents.
npm install submito
npx submito skillHow it works
required, type, minlength and pattern are checked live and shown inline.FormData over fetch, with a loading state and a double-submit guard.<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>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.' });
});const form = document.querySelector('#contact');
form.addEventListener('submito:success', (event) => {
const { response, formData } = event.detail;
console.log(response.message, formData.get('email'));
});Features
Your HTML constraints, checked as the user types. Errors appear inline and accessibly.
02A native <dialog> by default, themeable with CSS variables. Or SweetAlert2, or none.
03Math captcha, Google reCAPTCHA v3 and Cloudflare Turnstile. Tokens are added for you.
04intl-tel-input with validation, E.164 numbers, country and dial code fields.
05submito:before, :success, :error and :after bubble from the form, with the payload.
06Express, PHP, Laravel or WordPress. Replies are normalized into one response object.
For AI agents
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 →