`Form` post submission does not retain search parameters
See original GitHub issueWhat version of Remix are you using?
1.4.3
Steps to Reproduce
Impement a route that includes search params in the url.
/my-route?param=1234
On the page include a post form
<Form method="post">
<button type="submit>Submit</button>
</Form>
Native browser behaviour can be seen here thanks to @kiliman
https://codesandbox.io/s/form-action-params-8r86qw?file=/app/routes/test.tsx:732-987
Expected Behavior
Following the native browser behaviour, this should post back to /my-route?param=1234
Note that a method="get"
post would natively replace the search params by the nature of the submission method
Actual Behavior
The form will post to the base path /my-route
and trim off the search params
Issue Analytics
- State:
- Created a year ago
- Reactions:16
- Comments:11 (2 by maintainers)
Top Results From Across the Web
When submitting a GET form, the query string is removed from ...
When method is POST, and form is submitted, Query parameters in action url were intact (req.query) and input element data was sent as...
Read more >Solved: Retain specific form data when submitting
The form is in Formmode.new. When I press the "copy order + submit", I want to submit the entered data but copy some...
Read more >Sending form data - Learn web development | MDN
Once the form data has been validated on the client-side, it is okay to submit the form. And, since we covered validation in...
Read more >How can i submit form keeping existing query string intact in ...
Do you really need to submit your form with the use of 'GET' can't you use 'POST' instead? That could solve your problem...
Read more >Pardot Form Handlers Troubleshooting - Salesforce Help
Pardot doesn't support submitting data to form handlers via Ajax requests. When attempting to submit data to a form handler using Ajax, you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@manV Yes, fixing this issue will solve your scenario.
You can “fix” it now, by manually specifying your action.
The actual fix is to essentially do this automatically if action is not specified, as that is standard browser behavior.
the latest version(1.6.8) already fixed the issue.