Skip to content

Commit bef820d

Browse files
committed
Merge pull request #554 from SamyPesse/fix/formAction
Fix submit of form with input[name=action]
2 parents 73ffcc5 + 6e2c7e5 commit bef820d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

jquery.pjax.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,15 @@ function handleSubmit(event, container, options) {
119119
options = optionsFor(container, options)
120120

121121
var form = event.currentTarget
122+
var $form = $(form)
122123

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

126127
var defaults = {
127-
type: form.method.toUpperCase(),
128-
url: form.action,
129-
container: $(form).attr('data-pjax'),
128+
type: ($form.attr('method') || 'GET').toUpperCase(),
129+
url: $form.attr('action'),
130+
container: $form.attr('data-pjax'),
130131
target: form
131132
}
132133

0 commit comments

Comments
 (0)