formspree / formspree-js

The fastest way to hook up a React form
https://formspree.io/javascript
MIT License
63 stars 12 forks source link

[feature request] Allow manipulation of data between the form and submission #60

Open keithradford opened 1 year ago

keithradford commented 1 year ago

You can currently pass a data object into useForm which allows you to merge additional data from outside the form into the submission.

It would be nice if, similarly to this, we could pass callback functions which perform operations on data from our form before submission.

For example, if I have a dropdown for selecting a state:

This could be a new attribute of the options PR, or potentially could be inferred from the existing data attribute.