Open tomduggan85 opened 6 years ago
If you put these elements into a
https://github.com/gazaskygeeks/mpcc-assistant/blob/6c0d9f5c76bfbdaaca06b7ae96da798f17b20cd3/src/client/components/waiver/Waiver.js#L44-L50
You add an onSubmit handler to the form tag itself (
e.target.email.value
You might even be able to get the files[] array on e.target.upload in the same way, I can't quite remember if that works. Then you can build up the FormData object right in the upload function, right before posting to axios.
You might also be able to store any errors in state right in that same function in the code, and then use this.state.error to show the error state in render() instead of having to write out "document.getElementById('irr').textContent = ..."
What do you think?
If you put these elements into a