JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<input type="text" name="foo" />
<input type="submit" name="bar" value="Envoyer 1" />
<input type="submit" name="baz" value="Envoyer 2" />
</form>
JavaScript
$(function() {
$('form').on('submit', function(e) {
e.preventDefault();
var $activeElement = $(document.activeElement);
console.log($(this).serialize() + '&' + $activeElement.attr('name') + '=' + $activeElement.val());
});
});