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

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Change Javascript for Checkbox Prompt

Started by sumesh2429, 28 Nov 2011 01:10:00 AM

Previous topic - Next topic

sumesh2429

Hi ,

I have a multiselect list box prompt. I am collecting the values passed by the listbox prompt into a textbox prompt for some reporting requirement. I am doing this by using a Javascript which works fine with listbox prompt . The values i select in list box automatically comes up in Textbox prompt as Comma seperated values.

Now the problem is i want to use a checkbox prompt instead of this listbox . When i am converting the list to checkbox prompt , the script does not work . Can you let me know what all things i need to replace in the below Code so that the checkbox also works fine.


<script>
function assign_license_status()
{
// get the reference to the Cognos form
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() :
document.forms["formWarpRequest"]);
var i,tmp, selectcount;
tmp = "";
selectcount = 0;
// GET THE NAME OF THE LISTBOX SET TO THE list VARIABLE
var list = fW._oLstChoicesPre_license_status
for (var i=0;i<list.length;i++)
{
if (list.options(i).selected == true)
{
selectcount = selectcount + 1
if( tmp == "" )
{
tmp = list.options(i).value;
}
else
{
tmp = tmp + "," + list.options(i).value;

}
}
}
/* if (selectcount > 6)
{
alert("Please select 6 products or less to run this report");
}
else
{ */
if (selectcount >= 1)
{
fW._textEditBoxPost_license_status.value = tmp;
//will validate all prompts
// canSubmitPrompt();
//will submit the page - mimicks the click of a finish button
promptButtonFinish();
}
else

{
//will validate all prompts
// canSubmitPrompt();
fW._textEditBoxPost_license_status.value = tmp;
}
// }
}
</script>