JavaScript to limit the number of items in multi-select Text Box Prompt - Cognos 8

var form = getFormWarpRequest();
var textBox = form._textEditBoxMarketID;
var parent=textBox.parentNode;
var select;
do {
parent= parent.parentNode;
var select= parent.getElementsByTagName("select");
} while(select.length ==0);
var opt = select[0].childNodes;
var length=opt.length

if (length > 5) // User can select maximum of 5 values from prompt.
{
alert("You have selected " + length + " O&Ds, Please select only 5 or less ");
}

In the above code, MarketID is the ID of the TextEditBox Prompt

Comments

  1. How do I use this? Just insert a HTML item below the prompt? Tks in advance.

    ReplyDelete
  2. Hi Arul,

    I recently saw a Demo in which the Vendor had prompt options for selecting , grouping and sorting columns to create a List report. Have you heard of any way to do that?

    ReplyDelete

Post a Comment

Popular posts from this blog

RSV-VAL-0032 expression is not valid. If the item exists in a query but is not referenced in the layout, add it to a property list. CRX-API-0005 An error ocurred at or near the position '0'.

How can you extract all user information from Cognos Access Manager Namespace Report Utility and create Cognos Report out of it?

BME-EX-0047 Unable to read preferences for the requested interface..