Open
Description
Hi, I am defining a pjax container in that way:
$.pjax({
async: false,
push: false,
url: "http://theurl.com/form",
container: ".pjax-component[data-pjax-component-id='123']",
timeout: 30000,
});
It loads well the url (which contains a form), and I am implementing the form submission in that way:
// trap form submit
$(document).on('submit', ".pjax-component[data-pjax-component-id='123'] form", function(event) {
event.preventDefault(); // stop default submit behavior
$.pjax.submit(event, ".pjax-component[data-pjax-component-id='123']");
});
When the form is sumitted it reloads the whole page. I track the problem to the handleSubmit() function, it gets a null options value, and the optionsFor() function returns an options object with "http://theurl.com/#" as url value, when it should be "http://theurl.com/form", in fact, if I add the line:
options.url = "http://theurl.com/form";
to the handleSubmit() function, it works well (only for that container, of course)