Sending custom response in netlify-forms submission

Hey @deepp

You can set a custom thank you (or success) page while using Netlify Forms as outlined in the Success messages documentation.

Otherwise, you could look at the Submit HTML forms with AJAX documentation (on the same page as the link above) and display a message on screen.

The example code you have used in a function which would not use Netlify Forms, rather you would need to handle the form submission by sending it via email or submitting it to another data store (e.g. database.)