COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sandy_vitty on 16 Jan 2009 06:04:33 PM

Title: Hiding of Prompt using javascript
Post by: sandy_vitty on 16 Jan 2009 06:04:33 PM
Hi All

I have report with 2 value prompts.  The user can select either one of the prompts. So if he selects one the other has to be hidden. I am trying to do this with javascript

<script language="Javascript">

function m_click()
{
lochide();
}
function lochide()
{
var sec=document.formWarpRequest.elements["_oLstChoiceslocation"];
sec.style.visibility="hidden";
}
var Lbox = document.formWarpRequest.elements["_oLstChoicesorgarea"];
Lbox.onchange =  m_click;

</script>

when i select one value prompts the other becomes hidden but only of a few seconds. I becomes hidden and again shows back.

Appreciate any help

Thanks


Title: Re: Hiding of Prompt using javascript
Post by: jshanks on 18 Jan 2009 06:32:49 PM
Have you thought about using Conditional Blocks or render variables to accomplish what you want?  Either approach would allow you to hide an object, like the value prompt.  In my experience, Javascript often "breaks" when the Cognos platform is upgraded and our group tends to use it only when we can't get the needed functionality from the product.

If you set the "Auto-Submit" property of the first prompt to 'Yes', you can evaluate the NULL status of the parameter and then conditionally render the second value prompt.  Or vice-versa.