astroboy Posted March 27, 2020 Report Share Posted March 27, 2020 I have a virtual field that is set as a checkbox and virtual field for the button. If the checkbox is not checked it will hide the virtual field which has the button in it. How do I achieve this inside the DataPage? Quote Link to comment Share on other sites More sharing options...
Barbie Posted March 27, 2020 Report Share Posted March 27, 2020 HI @astroboy, This can be done using JavaScript. Below is the code which you can refer to: <script> document.addEventListener("DataPageReady", function() { button = document.querySelector('input[id^="Test"]'); if (document.getElementById("cbParamVirtual1").checked) { button.style.display = "inline"; } else { button.style.display = "none"; } document.getElementById("cbParamVirtual1").onclick = function() { if (document.getElementById("cbParamVirtual1").checked) { button.style.display = "inline"; } else { button.style.display = "none"; }}}); </script> I hope this works. - Barbie Quote Link to comment Share on other sites More sharing options...
SinJunYoung Posted March 28, 2020 Report Share Posted March 28, 2020 Hi, how is your DataPage configured (DataPage type, any existing scripts, etc)? You can actually apply rules in this scenario and apply these: 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.