Pages

Thursday, November 27, 2008

Cognos: Removing '---------------------------------' from Dropdown

Place following code in end of C:\Program Files\cognos\c8\webcontent\prompting\prompting.js

window.onload=function updte()
{
if(document.forms.length>0)
{
var pstr11=document.getElementsByTagName('Select');

if(pstr11!=null && pstr11.length>0)
{
for(var i=0;i {
if(pstr11[i].type=='select-one')
{
if(pstr11[i]!=null && pstr11[i].name !=null)
{

/*
//Following code is used to remove blank line from Status DDLBs
if((pstr11[i].length>=1) && (pstr11[i].name=='_oLstChoicesparamStatus' || pstr11[i].name== '_oLstChoicesstatusparam'))
{
pstr11[i].remove(1);
}

else if((pstr11[i].length>=1) )
{
pstr11[i][1].text='';
}

*/

//Used to remove Blank line at index 1 From ALL DDLBs
if(pstr11[i].length>=1)
{
pstr11[i].remove(1);

}



}
}

}


}
}

};

No comments: