COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: scabral79 on 15 Jul 2015 05:51:45 PM

Title: Radio Button onchange javascript not working
Post by: scabral79 on 15 Jul 2015 05:51:45 PM
Hi,
i have the following javascript on a radio button prompt:
<script type="text/javascript">
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);   
setTimeout('fW.elements["_oLstChoicesQuickSearch"].onchange =  setBufferZone();', 5); 
function setBufferZone()
{
var quickSearchList;
var quickSearchListSelected;
quickSearchList = fW._oLstChoicesQuickSearch;
     for (i=0; i < quickSearchList.length; i++)
     {
          if (quickSearchList.checked)
          {
               quickSearchListSelected = quickSearchList.value;
          }
     }
alert(quickSearchListSelected);
}
</script>
the alert runs the 1st time the page is loaded, but then it will not run again even on change of the radio button.  It seems like the javascript no longer sees the radio button group for some reason.
was wondering if anyone has run into this issue before.  Using Cognos version 10.2.1.
thanks
Scott