Collecting additional user data with Netflify form handling

Site: happy-keller-cce31a

Hi there!

My website generates a recommendation for the amount of salt a user should use, and I have a feedback form that pops up when they revisit the website. The form is rendered with JS, restates the last recommendation they received, and then asks for feedback (Too salty, not salty enough, etc).

I was just reading through the Netlify form handling documentation, and it sounds like there is a workaround to JS rendered forms. However, it looks like the workaround is using the name attribute, which sounds like it won’t work for my use case as I want to collect a JSON object along with the form submission. Does anyone know if there is a workaround for my use case? Thanks!

I found a solution! This awesome guide from css tricks showed me how to do the form submission with the fetch API https://css-tricks.com/using-netlify-forms-and-netlify-functions-to-build-an-email-sign-up-widget/

then I just make hidden inputs and use javascript to append the data.

1 Like