Skip to content

Remote functions: Impossible to set form values post-submission when CSR disabled #15465

@claytercek

Description

@claytercek

Describe the bug

When submitting a form with CSR disabled (or in a browser with JS disabled), there doesn't seem to be a way to set the form values after submission.

With client side JS, we can use the enhance() functionality to keep form values after submission. As far as I can tell, there's no way of doing this serverside because the form.fields.set() function returns early after a submission.

I think this would be resolved by #14815, but I'm also curious what the rationale is for ignoring set() calls after submission?

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-f1jca1md?file=src%2Froutes%2F%2Bpage.svelte

Logs

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^7.0.0 => 7.0.1 
    @sveltejs/kit: ^2.48.5 => 2.53.4 
    @sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.4 
    svelte: ^5.43.8 => 5.53.6 
    vite: ^7.2.2 => 7.3.1

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions