I have the following jQuery:
$('form').one('submit', function(e) {
e.preventDefault();
var id = $(this).data("id");
$("input.id-"+id+".column-name").val($("span.column-name.id-"+id).html());
$("input.id-"+id+".column-ext").val($("span.column-ext.id-"+id).html());
$("input.id-"+id+".column-dept").val($("span.column-dept.id-"+id).html());
$(this).submit();
});
It works great, except for some reason now it leaves out the name of the button that was clicked. Each form on the page has two buttons, 'save' and 'delete'. Clicking either one of these submits the form, and posts the data but not the data of the submit button (they both have corresponding names).
If I remove the above code, and just submit the form as usual, I get the button that was pressed.