defunkt/jquery-pjax — pull request #295 by kim3er (2013-06-21 08:49:58+00:00)
Title: Submitting button value

`$.pjax.submit` does not record the value of the submitting element.

On a standard form post, the value of the submitting button is passed along with the form data. This can be useful for describing the intent of a user.

For instance a form my have three submitting button; 'Save', 'Preview' or 'Publish'. The intent of the user can be established server side using the the button's value.

This is obviously not always a requirement, so `$.pjax.submit` is still a very useful function. However by attaching the handler to the `submit` event it is not possible, as far as I'm aware, to establish the value of the clicked button. This I assume is because the a form doesn't need a button in most browsers to fire that event.

So I have moved the logic from `$.pjax.submit` into and internal function called `formSubmissionHandler` and add an additional wrapper to the `formSubmissionHandler` called `$.pjax.submitClick`.

`$.pjax.submitClick` does the same as `$.pjax.submit`, but it is attached to the submitting elements of a form. This allows the submission handler to also identify the submitting element and record the value if one is present.

Rich