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

Select and search prompt

Started by ari_meta, 11 May 2010 04:48:12 PM

Previous topic - Next topic

ari_meta

I have select and search prompt with multi select option. I want to limit user to select at most 10 values. How can I make it possible? Any idea plz

Thanks

Ari

kattaviz

Hi,

You can do this by using javascript. I will try to post the script later.


Satish
thanks & regards
Satish Katta

ari_meta

Thanks Satish

I was looking for same.

Ari

kattaviz

Hi,

Drag an HTML Item above list box prompt and copy and paste the following javascript -

XXX is your prompt control name.

<script language="javascript">
function show() 
{
var count = 0;
var selOpts = document.forms["formWarpRequest"].elements["_oLstChoicesXXX"].options;
for(var i = 0, max = selOpts.length; i < max; ++i)
{
if(selOpts.selected)
  {
count= count+1;
  }
}
if(count>10)  // User can select maximum of 10 values from List prompt.
{
alert("You have selected " + count + " Values, Please select 10 or less values only");
}
else
       {
promptButtonFinish();
       }
}
</script>
If you are using IBM Cognos 8.3 or IBM Cognos 8.4 replace the line .

var selOpts = document.forms["formWarpRequest"].elements["_oLstChoicesXXX"].options;

with

var selOpts = getFormWarpRequest().elements["_oLstChoicesXXX"].options;

From the Toolbox, drag another HTML Item under the list box prompt and copy and paste the following code -

<button type="button" name="Validate" class="clsPromptButton"
style="font-family:Arial;font-size:10pt;font-weight :bold;width:2cm"
onClick="show()"> Finish </button>
thanks & regards
Satish Katta

ari_meta

Thanks Satish,

I have tried this in 8.4 and 8.4.1, But it does not work, do you have any suggestion for me.

Regards

Ari


ari_meta