Frequently asked questions
Get answers to commonly asked questions.
How do I run a function after form submission?
import { Composer, Formsmd } from "formsmd";
const composer = new Composer({
id: "my-form",
postUrl: "/api/endpoint"
});
const formsmd = new Formsmd(
composer.template,
document.getElementById("my-form-container"),
{}
);
// Override to log the result
formsmd.onCompletion = function(json) {
console.log(json);
}
formsmd.init();How do get my server's submission errors to work?
1. Configure the error field and message keys
2. Override the error parsing function
Last updated