COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognosdelaware on 17 Jul 2017 06:58:13 AM

Title: Is there a way to make a prompt required based off a radio button selection?
Post by: cognosdelaware on 17 Jul 2017 06:58:13 AM
Hi,

  I have a Value Prompt, set as a Radio button with "Selection 1" and "Selection 2" as the static choices.

  I also have two Text Box Prompts and if the Radio button "Selection 1" is selected, I want to make the first Text Box Prompt required, otherwise it should be made optional. If Radio button "Selection 2" is selected, I want to make the second Text Box Prompt required, otherwise it should be made optional.

  I'm using version 10.2.2.

  Is there a way to do this?

Thanks.
Title: Re: Is there a way to make a prompt required based off a radio button selection?
Post by: cognosdelaware on 17 Jul 2017 02:30:23 PM
To clarify the Text Box Prompt has a Parameter value of "parmAccountNumber" and is inside an HTML ITEM that has  <span id="accountnumbers_prompt"> inside it.

I tried the following but it did not work:

getControl("accountnumbers_prompt")["@required"]=true;
Title: Re: Is there a way to make a prompt required based off a radio button selection?
Post by: CognosPaul on 19 Jul 2017 04:54:48 PM
Add:
getControl('accountnumbers_prompt').checkData();