felte icon indicating copy to clipboard operation
felte copied to clipboard

Exclude Extra Values

Open Tam2 opened this issue 1 year ago • 0 comments

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 avatar Apr 10 '23 10:04 Tam2