Prashant S A Posted June 19 Share Posted June 19 Hi, I am looking to show/hide few elements in text area by using condition. This value in a condition is available in text area in the form of calculated value. How can I pass above calculated value to JavaScript. Below is the script which I am using(not working), HTML: //calculated value(0 or 1 ..) <pre hidden > <SpotfireControl id="b1cb3cb958c34edfbd1f8deeb4023e88" /> </pre> JS: // Function to show or hide elements based on the input value function toggleElements(value) { let element1 = document.getElementById('93e07d4fcc054f78a00f64d1dfe70556'); if (value = 1) { element1.style.display = 'block'; // Show element1 } else { element1.style.display = 'none'; // Hide element1 } } // Function to check the value from the input field $('#b1cb3cb958c34edfbd1f8deeb4023e88').on('change',function(){ let inputValue = document.getElementById('b1cb3cb958c34edfbd1f8deeb4023e88').value; toggleElements(Number(inputValue)); }) Link to comment Share on other sites More sharing options...
Solution David Boot-Olazabal Posted June 20 Solution Share Posted June 20 Hi Prashant, You may be able to achieve the same using iron python script (depending on what you want to hide): Kind regards, David Link to comment Share on other sites More sharing options...
Prashant S A Posted June 20 Author Share Posted June 20 Thanks David Really appreciate your prompt response Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now