Replies: 1 comment
-
This sounds similar to #8513, though that issue populates the inputs using the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having trouble with a form that is supposed to keep the input field values after submission. Essentially, the form is for modifying user data: it is generated with the current user data and upon submission the fields should stay the same (since they contain the same values that are sent to the server). However, when I submit the form, all the fields are emptied except the ones that have been modified.
For example, the form is populated like this:
If I change John to Joe and submit, the form is repopulated like this after submission:
The
+page.svelte
file looks like this (I use components for my Form and Input fields):In the
handleUpdate
function, the_user
variable is correctly updated and contains all the fields when I log it to the console after the assignment. I don't think the problem is coming from my Input component since I have the same issue using HTML elements. My FormPost component uses custom enhancement like so:I'm at a loss, why is the form only repopulated when the values are different than the ones taken from the PageData?
Beta Was this translation helpful? Give feedback.
All reactions