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

Hide a Label on prompt page

Started by hishamzz, 21 Sep 2011 07:24:18 AM

Previous topic - Next topic

hishamzz

Hi,

Quite new to Cognos so pardon any stupidity if it may seem :)

I have a label and a textbox on the prompt page which needs to be hidden/shown whilst clicking on a button which i have added via Javascript (HTML Item).

I am trying to find the means to control the visibility of the label and unfortunately have not being successful. :( The textbox i feel is possible but I am not really sure about the label.

Would any of you experienced folks have a solution to this predicament of mine?

Thanks in advance!
Zz

Arpitagrawal9

Just add a HTML item before and after the Label,Give a Div ID to that label and finally define a on-click event to show or hide the object

hishamzz

Hi Arpit,

Thanks for your reply!

I know this is asking of you too much but would you be able to spare a few mins to give me a step by step description along with a rudimentary javascript to go along with it ?

I have inserted and HTML item in front of the text item and afterwards. The first HTML Item contains <div id="Test"> and the second HTML item (after the text item) contains (</div>). Is this correct?

How exactly would i be able to make it not visible via javascript? Would REALLY appreciate it if you could spare some time and show me a rudimentary javascript which could do the needful.

Thanks again for your reply!

Hisham

Arpitagrawal9

<script language="javascript">
function toggle() {
   var ele = document.getElementById("toggleText");
   var text = document.getElementById("displayText");
   if(ele.style.display == "block") {
          ele.style.display = "none";
      text.innerHTML = "show";
     }
   else {
      ele.style.display = "block";
      text.innerHTML = "hide";
   }
}
</script>

<a id="displayText" href="javascript:toggle();">show</a> <== click Here
<div id="toggleText" style="display: none"><h1>peek-a-boo</h1></div>