vojtech-dobes / nette.ajax.js

Flexible AJAX for Nette Framework. Supports snippets, redirects etc.
https://componette.org/vojtech-dobes/nette.ajax.js/
MIT License
149 stars 85 forks source link

Form data submitted with netteAjax are incomplete #118

Open janbuchar opened 9 years ago

janbuchar commented 9 years ago

When a form with class ajax is submitted via XHR, the POST request contains the submit button that was used to submit the form, which is the correct behavior. When submitted using following code (#form doesn't have the ajax class), the request doesn't contain the submit button, which causes an invalid response.

$('#form').on('submit', function (e) {
    e.preventDefault();
    console.log('Submitting #form');
    $(this).netteAjax(e);
});