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
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
How do I use this? Just insert a HTML item below the prompt? Tks in advance.
ReplyDeleteHi Arul,
ReplyDeleteI 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?