Skip to content

Allow native post and put and patch form submissions #57

@AdeAttwood

Description

@AdeAttwood

Problem to solve

There is no way to do a native post request to the server using the Form component. It would be cool to have all the state management and validation that comes with the Form with a native post at the end of it.

Proposal

Allow the onSubmit prop to take a string of 'post' | 'put' | 'patch' along with the callback function that you can pass in now. If a string is passed in, then the method attribute on the form will be populated.

Then when the form is submitted it will be validated and then only when valid the form will be submitted.

We should probably also add a new prop for the action that allows us to submit the form to a different URL

Links / References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions