In general, form elements are used to send data to the server. It covers elements that define, for example, input or button elements. If you add the name and value attribute to your button elements, you will send this name-value pair to your server.
If you do not need to send any (additional) data to your server, just use the link elements and use them as buttons using CSS, if you want:
<a href="a.jsp" class="btn">a</a> <a href="b.jsp" class="btn">b</a> <a href="c.jsp" class="btn">c</a>
formaction attribute
Using the formaction attribute formaction you can specify multiple submit URLs for form one . Since the action attribute is no longer required for the form element, you can only define submit URLs in the formaction button. When the form is submitted, the browser first checks the formaction attribute; If this is not present, it begins to search for the action attribute in the form element. Thus, the action of the form is something like a backup or default, it is not required:
<form method="post"> <input type="text" name="my-data" value="my data"/> <button type="submit" formaction="a.jsp">a</button> <button type="submit" formaction="b.jsp">b</button> <button type="submit" formaction="c.jsp">c</button> </form>
If you use the form attribute to reference a linked form (id value), you can even put a button outside the form element:
<form method="post" id="myForm"> <input type="text" name="my-data" value="my data"/> </form> <button type="submit" formaction="a.jsp" form="myForm">a</button> <button type="submit" formaction="b.jsp" form="myForm">b</button> <button type="submit" formaction="c.jsp" form="myForm">c</button>
source share