Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude Extra Values #231

Open
Tam2 opened this issue Apr 10, 2023 · 0 comments
Open

Exclude Extra Values #231

Tam2 opened this issue Apr 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Tam2
Copy link

Tam2 commented Apr 10, 2023

Is your feature request related to a problem? Please describe.
I'm using Felte with Yup on a sveltekit project, I'm creating a schema in Yup and setting the initial values within the createForm function, I'm then using a combination of named inputs and binding to fields to set values, however I have some additional inputs (purely used to trigger functionality on the page, i.e. a checkbox which toggles between two input modes on a form), the problem is this checkbox is then included within the onSubmit function

Describe the solution you'd like
Would like an option to exclude extra fields, so only those defined within the validation schema are passed to the onSubmit function

It appears there is an option called stripUnknown available within Yup, is it possible to pass this option into the validator?

Describe alternatives you've considered
Manually compare and remove fields in the onSubmit function

@Tam2 Tam2 added the enhancement New feature or request label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant