Skip to main content
Here’s a detailed guide on making a POST call in JavaScript to submit form input to the Telivy backend when a submit button is clicked on your own form:
1

Set Up The HTML Form

Create a form with the method attribute set to POST and a submit button.
2

Attach A JavaScript Event Listener

Use addEventListener to listen for the submit event on the form.
3

Gather Form Data

Use FormData to construct a data object from the form’s input fields. Add the agentId or UTM Source fields to the form data if necessary.
Before you proceed any further, please make sure that the following validations to the data are passed:
Ensure the email has an ”@.”
4

Send The POST Request

Use the fetch API to send the POST request.Here’s the full example:
file.html