How can 2 action be done in the form
-
<form action="myurl"> <button name="test1">test1</button> <button name="test2">test2</button> </form>
I'll get urles on the buttons:
myurl?test1
myurl?test2
How do you get urles like this without js
myurl/test1
myurl/test2
-
Based on @Geslot, you can also use the attribute. https://webref.ru/html/button/formaction :
<form>
<button formaction="myurl/test1">test1</button> <button formaction="myurl/test2">test2</button>
</form>
Example with field:
<form target="_blank">
<input type="text" name="q" value="Hello, World!"> <button formaction="//bing.com/search">Bing Search</button> <button formaction="//google.com/search">Google Search</button>
</form>
https://jsfiddle.net/f5po9zck/