Replies: 2 comments 4 replies
-
Can you share more of the code? It sounds like the issue might lie elsewhere. I tried reproducing the issue here but was not successful |
Beta Was this translation helpful? Give feedback.
-
@s3812497 is right in that
So, one way to work around this would be to pass (Couldn't find a reference for this, but tested in a REPL) <input name="entry_id" value={entry_id} type="hidden" /> |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a vote button that can be clicked multiple times to add/remove votes. I'm using a form with a hidden input value that contains the ID of the entry being voted on.
In
+page.server.js
I retrieve the ID usingdata = await request.formData()
anddata.get('entry_id')
. However, if the form is submitted again,data.get('entry_id')
returns an empty string.I have a similar form for comments, and I noticed that user input is handled correctly when the form is submitted multiple times (
data.get('user_input')
returns the user input), but the hidden input values do not follow after the first form submission. What am I doing wrong?Beta Was this translation helpful? Give feedback.
All reactions