Jodie Posted December 13, 2023 Report Share Posted December 13, 2023 Hi - I have a data page where I've set up a filter by class so users can tab through different sections. Because the filters use buttons I use the following JS to stop the page from executing until the user has finished. When they're done, they click a virtual field to activate the submit button. In my original app, this works fine. The datapage type was different though - in every example I used the "details" page. I'm currently designing this in the tabular, then details page. The form appears to submit, but it actually doesn't enter any data into the table, and even when I ask to show a message, submit just returns back to the results page. My guess is the different datapage type is behind this issue but I have no idea how I can fix it (or if I can fix it...) Any help would be appreciated. Thanks document.addEventListener('BeforeFormSubmit', function () { event.preventDefault(); if (document.getElementById("cbParamVirtual1").checked) { document.forms["caspioform"].submit(); } else { event.preventDefault(); } }); Quote Link to comment Share on other sites More sharing options...
Jodie Posted December 13, 2023 Author Report Share Posted December 13, 2023 I just tried the datapage using the details page and the problem still persists. Quote Link to comment Share on other sites More sharing options...
Jodie Posted December 13, 2023 Author Report Share Posted December 13, 2023 Ok - so after more experimenting today, this is more likely a datapage issue and not JS, or its a local issue with my app. I can get my code to work with single record update - and it will update the right view. I can get my code to work if I change it to just update the table (not the view). I just can't get this code to update my table through the view via the table details page. And yes the view is set to update the right table, which is why it works on the single record update. (I've checked this and also recreated the view - as well as the pages). Quote Link to comment Share on other sites More sharing options...
PotatoMato Posted December 14, 2023 Report Share Posted December 14, 2023 Hi @Jodie, for checking, have you tried creating a simple details page without the code? Is it working? Quote Link to comment Share on other sites More sharing options...
Jodie Posted December 29, 2023 Author Report Share Posted December 29, 2023 Thanks @PotatoMato but I haven't experimented further. I found that I had enough JS skills to get the update form to handle everything that I was using calc fields to do. My form now only shows the right input fields for editing based on my the user's role and profile Quote Link to comment Share on other sites More sharing options...
Jodie Posted January 11 Author Report Share Posted January 11 I'm back with this problem again. And this time it's not as simple as switching datapage type from table >details page to an Update Record type. @PotatoMato - the form will only update the datatable when the JS is removed. If the JS is read, then the form appears to submit, but the page returns to the table data results. I updated to give a successful data submission message, and when the JS is used, this doesn't appear on submit. I know when we're referencing a view in a calc field sql we use _v_ to refer to the table and I'm wondering if there's something unique that needs to be added in the details form submission when the data originates from a view... Any ideas / suggestions would be greatly appreciated. I've also posted this in JS in case you've seen this issue posted there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.