I've been trying to trouble shoot this and even ChatGPT isn't giving me anything useful...
I have a tabular data report with a details page. Because I have additional buttons to allow my users to navigate my form by buttons, I need to use a virtual field and script to stop the form from submitting before they've tabbed through all the sections. This script works wonderfully on my submission datapages, and it's worked on other details pages before (though they're filtered and go straight to the details page). On this datapage I can't get this to pass the data into the datatable. If I remove the JS, the form submits the data to the table (but then the user can't move between the sections with the buttons). With the script, the submit button just returns the user to the table results page without submitting the data to the data table.
Any ideas on what might be missing?
My script in the footer:
<script>
document.addEventListener('BeforeFormSubmit', function () {
event.preventDefault();
if (document.getElementById("cbParamVirtual1").checked) {
document.forms["caspioform"].submit();
}
else {
event.preventDefault();
}
});
... Plus additional JS
</script>