COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Shruthi on 21 May 2012 07:18:02 AM

Title: Javascript for checkbox "unchecked" is not working in Firefox
Post by: Shruthi on 21 May 2012 07:18:02 AM
Hi

I am using cognos 10.1.1 and TM1 as the data source.
I am having a check box prompt "City" and "uncheck" java-script button in report page and I have incorporated this report in portal page.whenever user press the uncheck button, automatically all the values selected should be unchecked.

I have written the below java-script code for this requirement.

This code is working fine in IE browser but not in firefox (its working fine for first time click on Uncheck button, when we click the button again after new selection, no action is happening - selected values are still checked).

I need help writing Java-script to achieve this requirement both in IE & Firefox.

JavaScript Code
<input id="button1" value= "Uncheck" type="button" onclick="ClearSelections()"/>

<script>

function ClearSelections()
{

var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms);
if ( !fW || fW == undefined)
{
fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );
}

var preFix = "";
if (fW.elements)
{
preFix = fW.elements.value;
}

var list = fW._oLstChoicesCity;

for (var i=0;i<list.length;i++)
{
list.checked=false;
}

setTimeout('oCV' + preFix+ '.promptAction(\'reprompt\')', 0);

}
</script>

Thanks in advance.
Title: Re: Javascript for checkbox "unchecked" is not working in Firefox
Post by: Shruthi on 22 May 2012 05:00:36 AM
Any Solutions????
Title: Re: Javascript for checkbox "unchecked" is not working in Firefox
Post by: ranjaniganesh30 on 05 Nov 2014 06:51:19 AM
Please help.