Using netlify forms without an actual form?

Hi, @DzhideX. I do believe it will be possible to get this working.

The answer @hrishikesh has given is correct. Our forms handler (the backend system that accept the stores the form submission) creates a form handler endpoint by examining all HTML files in the deploy for <form> tags and then creating a form handler for any forms found.

The key thing to remember is that the form handler can only accept <input> fields that are defined in HTML.

So, in your example, you would need a form with an input named “data” with the same form name as will be used in your POST action. That HTML form can even be in a file which no one can access (because, for example, you wrote a redirect rule to block access to it). As long as the file exists in the deploy with that HTML form, the forms processing will create the form hander.

My point being, you don’t need to ever use the HTML form after the deploy. However, it must exist during the deploy because the HTML form is what causing our build system to create the form handler.

Once the handler exists, you can submit form submission using the pure HTML for or using AJAX (or other javascript) to submit a form. The form handler doesn’t know where the submission is coming from. As long as the form submission matches the definition in the HTML form, the submission will be successful.

There is more information about this here:

​Please let us know if there are other question or if it doesn’t work as expected.