Utilizing the framework's built-in formToJSON()
function, I have been able to retrieve form values. By utilizing a click event, I am able to log the values.
$$("#query-submit").on("click", function () {
var queryForm = app.formToJSON("#query-form");
console.log(JSON.stringify(queryForm));
});
Initially, this setup works perfectly when the page is first loaded. However, upon navigating to another page and returning back to the original form page, I noticed that the click event was no longer functioning as expected. Upon further investigation, I discovered a warning message in the console.
https://i.stack.imgur.com/YmIeO.png
I am trying to identify what may be causing this issue. Please note that all pages were loaded using AJAX requests.