-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
A normal submit will include the name and value of the submit button in the query string. This doesn't happen with the documented approach for using pjax.submit
, because the submit event on the form is bound.
I've been inserting an appropriately-configured hidden input to compensate for this:
$(document).on('click', 'form[data-pjax] input[type=submit]', function() {
$(this).after('<input type="hidden" name="' + this.name + '" value="' + this.value + '"/>');
});
$(document).on('submit', 'form[data-pjax]', function(event) {
$.pjax.submit(event, '#main')
})
I don't know if there is a better or more appropriate work-around.
Metadata
Metadata
Assignees
Labels
No labels