Skip to content

[Remote functions] Form enhance data parameter #14594

@robert-wettstaedt

Description

@robert-wettstaedt

Describe the problem

In PR #14383 (Validated forms), the form enhance callback was changed to pass a converted POJO instead of the raw FormData object. This change removes the ability to modify form data before submission, which is a significant regression for developers who need to alter form elements programmatically.

The Issue:

  1. Current behavior: The enhance callback now receives a POJO created by convert_formdata()
  2. Problem: Modifications to this POJO are ignored during submission
  3. Root cause: The original FormData object is still used for the actual form submission (as seen in lines 93-97)

Use Case:

I need to modify form data programmatically before submission (e.g., uploading files to a different server).

Describe the proposed solution

Either:

  1. Restore FormData access: Pass the original FormData object to the enhance callback alongside or instead of the POJO
  2. Make POJO changes effective: Ensure that modifications to the POJO are reflected in the actual form submission
  3. Provide both: Pass both the FormData and POJO, allowing developers to choose the appropriate method for their use case

Alternatives considered

No response

Importance

i cannot use SvelteKit without it

Additional Information

The conversion to POJO appears to be primarily for the validated forms feature, but this shouldn't break existing functionality for developers who need to manipulate form data directly.

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