MCPcopy Create free account
hub / github.com/formkit/formkit / submit

Function submit

packages/core/src/node.ts:3050–3060  ·  view source on GitHub ↗

* Submits the nearest ancestor that is a FormKit "form". It determines which * node is a form by locating an ancestor where node.props.isForm = true. * * @param node - A FormKitNode | FormKitNode * * @internal

(node: FormKitNode)

Source from the content-addressed store, hash-verified

3048 * @internal
3049 */
3050function submit(node: FormKitNode): void {
3051 const name = node.name
3052 do {
3053 if (node.props.isForm === true) break
3054 if (!node.parent) error(106, name)
3055 node = node.parent
3056 } while (node)
3057 if (node.props.id) {
3058 submitForm(node.props.id, node.props.__root)
3059 }
3060}
3061
3062/**
3063 * Reset to the original value.

Callers

nothing calls this directly

Calls 2

errorFunction · 0.90
submitFormFunction · 0.90

Tested by

no test coverage detected