If you are unable to create a new account, please email support@bspsoftware.com

 

Select and Search prompt - need to remove populated contents using javascript

Started by TheDarkKnight, 29 May 2010 05:33:20 AM

Previous topic - Next topic

TheDarkKnight

Hi Friends,

i need to empty the inserted values in the 'select and search prompt' in choices box using javascript.
i could able to identify and locate the indiividual values in the choice box using javascript code and display them as alerts [just for testing].
but not able to find a javascript method to remove the contents populated. i tried the method 'remove'. but of no use since this prompt does not support this method.

am working in cognos 8.3

Really appreciate any sort of help in this!!!

Best Regards
Dinesh



TheDarkKnight

i got the javascript for this. Hope this will be useful.

Add the below script in the HTML.
------------------

function f()
{
for(j=0;j<document.links.length;j++)
{
y=document.links[j];
   {

if (y.id.indexOf("DE") == -1 &&   y.id.indexOf("SELECT") != -1 )
if(j==3) // this number will change depending on the place u place the prompt. Try adjusting it between 1 to 9 if the script doesnt work in first instant.//
document.getElementById(y.id).click();
     }
}

Cheers
TDK