Form actions #11146
Unanswered
joshshipton
asked this question in
Q&A
Form actions
#11146
Replies: 2 comments
-
https://kit.svelte.dev/docs/form-actions#anatomy-of-an-action <script lang="ts">
import type { PageData, ActionData } from './$types';
export let data: PageData;
export let form: ActionData;
</script>
{#if form?.success}
<!-- this message is ephemeral; it exists because the page was rendered in
response to a form submission. it will vanish if the user reloads -->
<p>Successfully logged in! Welcome back, {data.user.name}</p>
{/if} you could also use |
Beta Was this translation helpful? Give feedback.
0 replies
-
This makes sense but if i want to redirect after form submission how can I make this message persist through page navigation through svelte-stores? |
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.
-
Is there a way to check for successful form submission and then return that to the client side after submitting a form that uses a form action. E.g form is submitted, form action on server runs, then the client side gets the response. Pretty much just want to be able to discern whether or not there was an error submitting the form on the server to the client. thanks in advance ^_^
Beta Was this translation helpful? Give feedback.
All reactions