Submit Ajax Form including Button Name

Created 2021-04-12

When submitting an ajax from, form.serialize() does not include the clicked button. We need to manually append this from the originalEvent attribute

$("form").on("submit", function(event)) {
    var data = $(this).serialize();
    if(event.originalEvent.submitter) {
        data = s['name'] + "=" + s['value'] + "&" + data
    }
    // continue
}