How to perform fetch action on the form? #98
Unanswered
iUnknownAdorn
asked this question in
Q&A
Replies: 1 comment
-
Hello @iUnknownAdorn form action property is url, not javascript code. You don't need fetch here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I created a form, and now want to submit the data to backend. I followed the airtable tutorial and wondering instead of pushing form data to the webhook, can i simply call a POST api using fetch.
I tried going to the form properties, selecting Action and pasting
fetch('https://my-api-url', { method: 'POST', body: new FormData(document.forms['my-form-name']) })
The POST request is made to
https://saas-8xwed.wstd.io/get-access?index=&_data=routes/[get-access]._index
and I get
Invalid action URL, must be valid http/https protocol
In the code, there is this section:
id={"my-form-id"}
action={"fetch('https://my-api-url', { method: 'POST', body: new FormData(document.forms['get-access-form']) })"}
Curious if this is even possible.
Beta Was this translation helpful? Give feedback.
All reactions