Если вы используете vanilla js, вы можете сделать HTML с формой и прослушать все изменения формы, когда пользователь щелкает, что-то вроде этого :
<form id="my-form">
<input type="text" name="username">
<input type="text" name="full-name">
<input type="password" name="password">
<button type="button" id="search">Search!</button>
</form>
const searchButton = document.getElementById("search")
const inputs = document.getElementById("my-form").elements;
const inputByIndex = inputs[0];
const inputByName = inputs["username"];
searchButton.addEventListener("click", functionWhichIWillCommunicateWithTheServer)
со значениями формы вы можете использовать что-то вроде fetch для связи с вашим сервером.
// The parameters of the endpoint are comming from the form
function functionWhichIWillCommunicateWithTheServer() {
fetch("someEndpointWithTheirParameters")
.then(res => res.json())
.then(data => console.log(data))
}