Skip to content

Form actions on +layout.server.js? #6764

Answered by dummdidumm
madeleineostoja asked this question in Q&A
Discussion options

You must be logged in to vote

It's because it couldn't fall back to native behavior - a layout is not a page you can reload. The way to solve this is to have a route which deals with the newsletter, and call actions from there in your layout. That way with JS enabled you stay on the current page, but if for some reason JS isn't enabled it redirects to the newsletter signup page instead.

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@madeleineostoja
Comment options

@madeleineostoja
Comment options

@theetherGit
Comment options

@dan-cooke
Comment options

@danilomozer
Comment options

Answer selected by dummdidumm
Comment options

You must be logged in to vote
2 replies
@beerinho
Comment options

@theetherGit
Comment options

Comment options

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