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
I think you should change the line:
list_prompts.selectedIndex = -1;
with:
list_prompts[i].selectedIndex = -1;
You are not using the counter anywhere....
for (var i=0;i<list_prompts.length;i++)
{
list_prompts.selectedIndex = -1;
}
}
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;