CoopperBackpack 23 Posted July 8, 2020 Report Share Posted July 8, 2020 Hello, I have a Submission form DataPage , one of the fields is set to the Calculated value. And I need to display the value from this field in the HTML block. How can I achieve this? Quote Link to post Share on other sites
Johnny 1 Posted July 8, 2020 Report Share Posted July 8, 2020 Hi @CoopperBackpack Hope you are well. Here is the code that would let you to achieve the result. You should insert it in your HTML block. And I will explain the code below. Please be aware, that I used Virtual Field for this example with name "cbParamVirtual1" as a Calculated Value, since in Caspio virtual field has syntax [@cbParamVirtual1]. You can put there your own field name if needed instead of "cbParamVirtual1" <div class="message"></div> <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { document.querySelector('input[id*="cbParamVirtual1"]').addEventListener("change", myFunction); function myFunction(event) { let virField = event.target.value; document.querySelector('.message').innerHTML = "your text should be here " + virField; document.removeEventListener('DataPageReady', myFunction); } }); </script> This is the part where you insert text, added by JS code:: <div class="message"></div> The JS code has place, where you should enter the text you want to have in HTML block. Here is this part, replace "your text should be here " for the one you need. document.querySelector('.message').innerHTML = "your text should be here " + virField; Hope it helps. Regards, Johnny CoopperBackpack 1 Quote Link to post Share on other sites
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.