views:

349

answers:

2

I am looking for javascript for enabling/disabling two date range/date prompts in Cognos.

Does anyone have any javascript for disabling/enabling two date range prompts? If I select the Date1 prompt, then the Date2 prompt has to be greyed out and vice versa.

I am using Cognos 8.3 SP2.

A: 

How about taking the approach of conditionally rendering one date prompt or another based upon a selection from a radio button or combo box? Doing this would ensure that only one prompt is selected, and would not require javascript.

Jamey
A: 

First off, I'll admit I usually put jQuery into my Cognos reports nowadays. If you don't have the ability to put it into a local library, you can link to the Google hosting of it. You do this using an HTML Element with a script tag inside it (detailed explanation here).

Second, you can put HTML Element (div or span tags with an id) around the prompts. This gives you a way to easily select them.

Third, you bind a function to each one (using .click() ) which uses the .hide() jQuery function on the other.

rossdavidh