Skip to content
Discussion options

You must be logged in to vote

Hi Pasquale,

I've made a stackblitz example for you here:
https://stackblitz.com/edit/sveltejs-kit-template-default-sfyuzf?file=src/routes/Something.svelte

Return a value from the action via return, or return invalid(400, {})
+page.server.js

export const actions = {
	default: () => {
		console.log('form action running');
		return { success: true };
	}
};

Receive the value from $page.form
Component.svelte

<script>
	import { page } from '$app/stores';
</script>

<h2>The form value</h2>
<p>{JSON.stringify($page.form)}</p>

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@DePasqualeOrg
Comment options

@teemingc
Comment options

@DePasqualeOrg
Comment options

@teemingc
Comment options

@DePasqualeOrg
Comment options

Answer selected by DePasqualeOrg
Comment options

You must be logged in to vote
1 reply
@sphinxc0re
Comment options

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