Skip to content

Endpoints - support form submissions for noscript and fetch users alike #3326

Answered by geoffrich
tmaxmax asked this question in Q&A
Discussion options

You must be logged in to vote

The SvelteKit starter app does this via an enhance action on the form. If JS is enabled, then the enhance action runs and submits the form via fetch. Otherwise, it does a regular form submit.

In the /form endpoint, it detects if the submission was via fetch or regular form submission. If it was a regular form submission, then it performs a redirect instead of returning JSON.

You can see further discussion on this issue: #1203 (comment).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ignatiusmb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants