javascript - In form data, pass info about which button was clicked -- after confirmation modal -
the click event on submit button triggers confirmation modal. when user clicks on confirmation button, form sent without original submit button data, need. simplified code: <form action="/action" method="post"> <!-- inputs --> <button type="submit" name="foo" class="with-confirmation-modal" /> </form> <script> $(document).on('click', '.with-confirmation-modal', function() { $form = $(this).closest('form'); $modal = $('#modal'); $modal.on('click', 'button[type=submit]', function() { // form sent without info button // clicked prior modal $form.submit(); return false; }); $modal.modal('show'); return false; }); </script> what's way deal ? when post form clicking on <button type="submit" name="foo" /> data posted includes name of b...