Skip to content

Commit

Permalink
Fix submit of form with input[name=action]
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyPesse committed Aug 8, 2015
1 parent 73ffcc5 commit 8c95ae0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jquery.pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,16 @@ function handleClick(event, container, options) {
function handleSubmit(event, container, options) {
options = optionsFor(container, options)

var form = event.currentTarget
var form = event.currentTarget;
var $form = $(form);

if (form.tagName.toUpperCase() !== 'FORM')
throw "$.pjax.submit requires a form element"

var defaults = {
type: form.method.toUpperCase(),
url: form.action,
container: $(form).attr('data-pjax'),
url: $form.attr('action'),
container: $form.attr('data-pjax'),
target: form
}

Expand Down

0 comments on commit 8c95ae0

Please sign in to comment.