-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow same-page navigations on form posts (#9055)
* Allow same-page navigations on form posts * Add another comment
- Loading branch information
Showing
4 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/astro/e2e/fixtures/view-transitions/src/pages/form-two.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import Layout from '../components/Layout.astro'; | ||
if(Astro.request.method === 'POST') { | ||
const formData = await Astro.request.formData(); | ||
const name = formData.get('name'); | ||
return Astro.redirect(`/form-response?name=${name}`); | ||
} | ||
--- | ||
<Layout> | ||
<h2>Contact Form</h2> | ||
<h3>This form does not have an `action` defined</h3> | ||
<form method="post"> | ||
<input type="hidden" name="name" value="Testing"> | ||
<input type="submit" value="Submit" id="submit"> | ||
</form> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters