How to use an action of a form in html


What kind of guys do I have a problem with, I'm trying to make a server with a register and a login and I could connect the whole database perfectly but my problem is that I have a form where there are 4 fields of input text and a submit and I want to that when I touch the submit the form with the action method I send a "route" and in express I can generate a and with that route I can grab the input values and save them. The issue is that that "route" that the action method generates never gives me. This is my form:

<form action="/register/add" method="post"></form>
        <input type="text" name="inputname" id="inputname" placeholder="Nombre">;                                
        <input type="text" name="inputsurname" placeholder="Apellido" id="inputsurname">
        <input type="text" name="inputemail" placeholder="Email" id="inputemail">
        <input type="password" name="inputpassword" placeholder="Contraseña" id="inputpassword">
        <button type="input" id="inputbutton">¡Registrate!</button>

And the code where I ask the "route" to the action to give an answer is this:"/register/add", (req, res)=>{

}); Do I have to call the script where I have the in the html? Do I need any other dependence on express like bodyparser or some of that style? I'm using express. Excuse the ignorance, thank you very much.

asked by Pedro Danderfer 11.11.2018 в 01:56

0 answers