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

Clear the value prompt

Started by aravind006, 18 Jun 2015 06:08:09 AM

Previous topic - Next topic

aravind006

Hi,

How to reset the value prompt values in cognos 10.2.2?
I have added the below code ,but it is not working as expected.

<script>
var list_prompts = document.getElementsByTagName("select");

function ClearSelections(){
  for (var i=0;i<list_prompts.length;i++)
  {
    list_prompts.selectedIndex = -1;
  }
}
</script>

<a href="JavaScript:ClearSelections()">Clear All Selections</a>

Please do the needful.

Thanks & Regards,
Aravind

qvixote

#1
I think you should change the line:

list_prompts.selectedIndex = -1;

with:

list_prompts[i].selectedIndex = -1;


cognos810

You are not using the counter anywhere....
for (var i=0;i<list_prompts.length;i++)
  {
    list_prompts.selectedIndex = -1;
  }
}

qvixote

That was I meant, but the page replaced the [ i ] since it's used to indicate italized text. You should use this line inside the FOR statement:

list_prompts[i].selectedIndex = -1;