0

so i'm trying to make a simple web application on eclipse JEE using Java as a backend.

I tried with postman and my Query is working as expected. Now , I'm building a html file (jsp) and I want to make it user interactive. The query is to add a new element.

The problem is I don't know how can I make a button passes the values from inputs to the query param.

    <html>
<body>
<center>
    <h2>Gestionnaire des Patients</h2>
   
    
    
    <p><a href="webapi/myresource">List Patient</a>
    <form action="webapi/myresource/ajout?num=(numPatient)&nom=HTML&prenom=(prenomPatient)&heure=(heurePatient)" method="POST">
   
    <input type="text" placeholder="Numero du patient" id="numPat">
    <input type="text" placeholder="Nom  du patient"id="nomPat">
    <input type="text" placeholder="Heure rendezvous du patient"id="heurePat">
    <input type="submit" value="Ajouter le patient">
    </form>
    
    </center>
    <script>
    
    var numPatient = document.getElementById("numPat").innerHTML;
    var nomPatient = document.getElementById("nomPat").innerHTML;
    var prenomPatient = document.getElementById("prenomPat").innerHTML;
    var heurePatient = document.getElementById("heurePat").innerHTML;


    </script>
</body>
</html>

0 Answers0