The trivial task became really time consuming for me. I am doing really basic user interface for web project(focus on business logic). If there is already exact answer to my question please redirect me, I will delete it straight away. I just don't really know what to search for, basic phrases are too vague.
The scenario:
I need to get request either with /someurlrequest?edit=(idOfelement) or /someurlrequest?populate=(idOfElement) , but I get /someurlrequest?edit=(idOfelement)&populate=(idOfElement) (GET is just for showing what is sent, POST is preferred)
Whenever set of elements appear I want to have two buttons, but whenever I do it the way I've shown below the form submit action grabs both values(Edit and Populate) for request meaning that further I can't process the request since I don't know which button was pressed as both name/value pairs are passed, I get say Edit=1 and Populate=1 , I obviously want only single pair either Edit=1 or Populate=1.
<c:forEach var="TrainingProgram" items="${programbank}">
<form method="get" action="/someurlrequest">
<p> ${TrainingProgram.name}</p
<p> ${TrainingProgram.shortDescription}</p>
<p>
<input value="Edit" type="submit" />
<input name="edit" style="display: none;" value="${TrainingProgram.programId}" />
<input value="Populate" type="submit" />
<input name="populate" style="display: none;" value="${TrainingProgram.programId}" />
</p>
</form>
</c:forEach>
I would be able to get away with basic:
<a href="/somerequest/edit=${TrainingProgram.programId}"> Edit <a/>
<a href="/somerequest/populate={TrainingProgram.programId}"> Populate <a/>
but this would limit me to GET and as I mentioned before I would like POST.
Is it possible to solve it with plain HTML(missing something really trivial?)? JS solutions are also welcome, though I understand JS only on copy-paste black-box level and I don't want people doing job for me and then effectively blaming me, unless it is really basic task to do in JS :-)
Thank You,