COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: iulian.bobalca on 07 Sep 2007 01:17:12 AM

Title: Prompts again
Post by: iulian.bobalca on 07 Sep 2007 01:17:12 AM
Hello all!

A simple question about prompts: if you have two value prompts, can you make only one of them required at runtime? I mean, the user should select a value in either one of them, but let him choose which one.

Thanks !
Title: Re: Prompts again
Post by: Suraj on 07 Sep 2007 09:27:22 AM
If you search ittoolbox forum, there is a javascript solution posted for allowing only one of the two prompts. If one is selected, another is automatically disabled.
Title: Re: Prompts again
Post by: iulian.bobalca on 10 Sep 2007 02:11:00 AM
From http://tinyurl.com/2axu7t (http://tinyurl.com/2axu7t) I got this :

These are some expressions I have seen in the postings here.

To refer to an element with ID = UID1, use expressions like:

var xxx = document.formWarpRequest._textEditBoxUID1.value.

var list=document.getElementById("UID1");

document.getElementById("_textEditBoxUID1").style.d isplay = ?none?;

Text Box Prompt = ?_textEditBoxUID1?
List Box Prompt = ?_oLstChoicesUID1?

document.formWarpRequest._oLstChoicesUID1[0].text = 'Select Product Name';


Which one do you usually use ? Thanks.
Title: Re: Prompts again
Post by: Suraj on 11 Sep 2007 04:59:31 PM
I haven't test that code above but here is one:

document.forms["formWarpRequest"].elements["_textEd itBoxPromptName"].dis
abled = true;
document.forms["formWarpRequest"].elements["txtDate PromptName"].disabled
= false;

Here are some posts discussing this issue:

http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos-reportnet-l/conditionally-making-a-prompt-inactive-727556

http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos-reportnet-l/report-studio-prompt-question-1554303

http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos-reportnet-l/clear-a-prompt-by-selecting-another-1409238?ref=http%3A%2F%2Fsearch%2Eittoolbox%2Ecom%2Ftechnical%2Dgroups%3Fr%3Ddisable%2Bjavascript%2Bprompt