MCPcopy Create free account
hub / github.com/docusealco/docuseal / submit

Method submit

app/javascript/elements/fetch_form.js:14–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 }
13
14 submit () {
15 fetch(this.form.action, {
16 method: this.form.method,
17 body: new FormData(this.form)
18 }).then(async (resp) => {
19 if (!resp.ok) {
20 try {
21 const data = JSON.parse(await resp.text())
22
23 if (data.error) {
24 alert(data.error)
25 }
26 } catch (err) {
27 console.error(err)
28 }
29 }
30 })
31 }
32
33 get form () {
34 return this.querySelector('form')

Callers 2

connectedCallbackMethod · 0.45
connectedCallbackMethod · 0.45

Calls 1

textMethod · 0.80

Tested by

no test coverage detected