Skip to content

Commit 8c95ae0

Browse files
committed
Fix submit of form with input[name=action]
1 parent 73ffcc5 commit 8c95ae0

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
@@ -118,15 +118,16 @@ function handleClick(event, container, options) {
118118
function handleSubmit(event, container, options) {
119119
options = optionsFor(container, options)
120120

121-
var form = event.currentTarget
121+
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 = {
127128
type: form.method.toUpperCase(),
128-
url: form.action,
129-
container: $(form).attr('data-pjax'),
129+
url: $form.attr('action'),
130+
container: $form.attr('data-pjax'),
130131
target: form
131132
}
132133

0 commit comments

Comments
 (0)