If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Hiding of Prompt using javascript

Started by sandy_vitty, 16 Jan 2009 06:04:33 PM

Previous topic - Next topic

sandy_vitty

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



jshanks

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.