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

 

Concatenating values selected in a listbox and assigning it to a text box

Started by sunny.darediya, 22 Sep 2009 02:13:10 AM

Previous topic - Next topic

sunny.darediya

Hi All,

I am facing an issue in Report Studio, I need to pass on multiple values of cascaded prompt to a procedure. I found a JS which concatenates the values in checkbox and assigns it to a text box which can be passed to procedure. The problem I am facing now is that a checkbox cannot be cascaded with a checkbox. So i need to modify this script to work for listbox. Any help would be appreciated. Pls find the script for checkbox below:

<script>
function assignParamValue()
{
//get the reference to the Cognos form
var fW = (typeof getFormWarpRequest=="function" ? getFormWarpRequest() :document.forms["formWarpRequest"]);

tmp = "";
// get the handle for the 1st checkbox, add div to distinguish
var prompt1 = document.getElementById('checkboxPrompt1');
// find all the children of the div of type checkboxes.
for (i=0; i < prompt1.childNodes.length; i++)
{
var node_list = prompt1.getElementsByTagName('input');
for (var i = 0; i < node_list.length;i++)
{
   var node = node_list;
   if (node.getAttribute('type') =='checkbox')
   {
      if (node.checked)
      {
         if( tmp == "" )
         {
            tmp = "'"+node.value;
         }
         else
         {
            tmp = tmp + "','" +node.value;

         }
      }

   }
}
}
tmp=tmp+"'";
fW.p_TXTGENRE.value =tmp;
}
</script>