...

View Full Version : Eliminate rows in a dropdown prompt



cogman
08-22-2007, 04:44 PM
First of all, I have used JS very sparingly with Coldfusion 7.0 and Cognos 8.2.
I am trying to eliminate some rows in a Cognos 8.2 dropdown prompt . Cognos knowledge base listed the following JS that did eliminate the column name in the first row.

<script>
document.formWarpRequest._oLstChoicesUID[0].text = ' ';
</script>

The problem is that I need to eliminate the first 2 rows. Any ideas

nikkiH
08-22-2007, 07:01 PM
<script>
document.formWarpRequest._oLstChoicesUID[0].text = ' ';
document.formWarpRequest._oLstChoicesUID[1].text = ' ';
</script>

Will eliminate only the text.
To remove the options themselves from a select element, use

<script>
document.formWarpRequest._oLstChoicesUID[0] = null;
document.formWarpRequest._oLstChoicesUID[0] = null; // not a typo, the "2nd" item is now the first after the statement above executes
</script>

cogman
08-23-2007, 05:37 PM
It worked! Thanks so much



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum