Elderberg Posted April 20, 2023 Report Share Posted April 20, 2023 https://howto.caspio.com/datapages/ajax-loading/ the above page speaks to the caspio supported addEventListeners, specifically: DataPageReady BeforeFormSubmit FormSubmitted but DataPageReady fires when the page loads but DOES NOT wait for calculated fields/scripts to be completed. How can I trigger code AFTER the calculated fields have completed their calculations? Quote Link to comment Share on other sites More sharing options...
Volomeister Posted April 25, 2023 Report Share Posted April 25, 2023 Hi @Elderberg I assume you meant the calculated value in the virtual field on the form DataPage? Because the calculated field on the report DataPage should be calculated before DataPageReady event. If we are talking about calculated value in the virtual field, you can add an event listener to this field to listen to the "change" event. When the "change" event is fired, it means that the desired calculation is completed, and you can run your script after: <script> document.querySelector('[name="cbParamVirtual1"]').addEventListener('change', e=>{ // your script goes here }) </script> If you have more than one virtual field, some extra coding will be required to ensure that all virtual fields have their respective calculated values ready. Could you share a link to the DataPage you are working on for more context? 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.