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

Have element (block) hidden with a button to unhide & rehide

Started by Arthur57, 12 Jun 2014 04:00:58 AM

Previous topic - Next topic

Arthur57

Hi,

I have a block that contains a tree-prompt that I want to have hidden when the report is run.  Using HTML items I have managed to create a button that will allow me to hide & show this block, although when the report is run the block is shown (I need it to start hidden).  I am having trouble figuring out how to run the report with the block initially hidden.

Could anyone help me to modify the code below so that I can get this to work?

First HTML item to generate button:
//Creates show/hide button
<a href="JavaScript:ShowHide()
">Click here to show/hide report filter</a>


First span HTML item:
<span id = "Prompt_Block">

Bottom span HTML item:
</span>

Last HTML item that shows/hides Prompt_block element:
<script language="javascript">
function ShowHide(){
var el = document.getElementById("Prompt_Block");
if ( el.style.display != 'none' )
{el.style.display = 'none';}
else {el.style.display = '';}}
function startHidden(){
var el = document.getElementById("Prompt_Block");
el.style.display = 'none';}
</script>

Satheesh

Hi,


you can add below code



<script language="javascript">


var ell = document.getElementById("Prompt_Block");
ell.style.display = 'none';



function ShowHide(){
var el = document.getElementById("Prompt_Block");


if ( el.style.display != 'none' )
{el.style.display = 'none';}
else {el.style.display = '';}}


</script>




Thanks & Regards
Satheesh Chapparapu
Mumbai

Arthur57

Thanks Satheesh.  That's the perfect response - it works!

Many thanks