<body>
<form action="#" method="post">
<div><label for="subject">Subject: </label><input type="text" name="subject" id="subject"></div>
<div><label for="customer">Customer: </label><input type="text" name="customer" id="customer"></div>
<br>
<button type="submit">submit</button>
</form>
</body>
<script>
var form = document.querySelector("form");
form.addEventListener("submit",(e)=>{
e.preventDefault();
//This URL comes from the flow trigger when an HTTP request is received.
const url="<HTTP POST URL>";
const xhr = new XMLHttpRequest();
xhr.open("POST",url);
xhr.setRequestHeader("Content-Type","application/json");
let body={
"subject":document.forms[0]['subject'].value,
"customer":document.forms[0]['customer'].value
}
xhr.send(JSON.stringify(body));
})
</script>
The flow is shown below.
Additionally, if you want to convert marketing form submission data into custom entity records, you can refer to the following link.