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

How do I validate Text Box Prompt has a value and is selected?

Started by cognosdelaware, 01 Aug 2017 09:28:09 AM

Previous topic - Next topic

cognosdelaware

Hi,

  I have a Multi-Select Text Box Prompt with the name called "ACCOUNT".

  As part of the control there is a box called "Choices:" which hold any values they insert(add) and then they need to select one or all of them.

  I need to do two things(via JavaScript):

1) Make sure this "Choices:" box has data in it and not empty
2) If it has data in it, that at least one item has been selected

Thanks,

Tony


 


cognosdelaware

I was able to figure it out, for those that need it:

var report = cognos.Report.getReport("_THIS_");
var account = report.prompt.getControlByName('ACCOUNT');

if (account.getValues().length <= 0)
    {
        alert("You must enter an Account Number");
    }