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

Prompts

Started by rr.bi1212, 26 Dec 2016 09:52:32 PM

Previous topic - Next topic

rr.bi1212

I have 2 prompts in the report...the user needs to select either of the prompt and click finish button. The prompt filter cannot be optional...it has to be required.Both are text box prompts.
So until one of the prompt is entered the finish button should not be enabled...please help.

SpareTire

Hi,

I am not sure the statement sounds logical to me. If Prompt#1 & Prompt#2 are both required, and User fills in Prompt#2 ---how would cognos know what to fill in Prompt#1 without the user?

Sounds like a Dr.Suess riddle....

Sounds like you need both prompts to be optional but you dont want the finish button to be available until at least one of the prompts are filled.

rr.bi1212

Yeah....what I need is finish button should jot be enabled until one of them is entered ifthe prompts are optional.

SpareTire

I came across a solution doing something else. You delete the finish button provided by cognos, insert your own finish button and then create a function that checks the value of each text box to either submit it or alert the user.

Here is the J/S for the function;


<script type="text/javascript">
function validate()
{
var fW = (typeof getFormWarpRequest == "function" ?getFormWarpRequest() : document.forms["formWarpRequest"]);
if ( !fW || fW == undefined)
{ fW = ( formWarpRequest_THIS_ ?formWarpRequest_THIS_ : formWarpRequest_NS_ );
}

var Textbox1 = fW._textEditBoxTextbox1.value;
var Textbox2 = fW._textEditBoxTextbox2.value;

if ((Textbox1 == '') && (Textbox2 == ''))
{alert('At least one prompt must be filled');}
else
{promptAction('finish');}
}
</script>


Then delete the Cognos finish button and insert your own into the footer:


<input type="button" onclick="validate()" value="Finish"/>



Don't forget to name your text boxes: Textbox1 and Textbox2