I need to remove the title and dotted line from a value prompt. I have the following Javascript in an HTML Item to do it:
<script>
var f = getFormWarpRequest();
var prompt = f._oLstChoicesX;
prompt.remove(1);
prompt.remove(0);
prompt.removeAttribute("hasLabel");
</script>
Note1: "X" is the name of the prompt specified in the value prompt properties.
Note2: I'm using Cognos 8.4 Report Studio
This script works perfectly the first time I run the report however, it only works the first time. If I rerun the report the title and dotted line reappear. Any suggestions to eliminate them as well on a rerun?
TIA,
Marcia
Try this ..
<script language="javascript">
//your Value Prompt is your first Select object, if its the 2nd, change
- -> [1]
var list=document.getElementsByTagName("SELECT")[0];
list.remove(1);
list.remove(0);
list.removeAttribute("hasLabel");
list.options[0].selected = true;
canSubmitPrompt();
</script>
Isn't it great that Cognos 10 makes this easy now? It's just a property of the prompt object!
Awesome. Haven't seen 10 yet, but,sounds great.Script to do such trivial stuff was annoying.