COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognosun on 31 Mar 2016 11:27:54 AM

Title: JavaScript - Date Prompts - Dynamic/Onchange updation
Post by: cognosun on 31 Mar 2016 11:27:54 AM
I have 2 Date prompts in the prompt page ( date1 and date2):

If user selects a value from date1 ( say 30th march 2016) then the value in the second prompt (date2) should change to 23rd March 2016.

Is there any javascript which will do this dynamic task....related to onchage funtionality.

There are some similar posts in this site related to manual updation in textbox prompt, but is there any script for Date prompts in particular ?

Many thanks in advance
Title: Re: JavaScript - Date Prompts - Dynamic/Onchange updation
Post by: BigChris on 01 Apr 2016 02:10:21 AM
Is the second prompt really a prompt, or do you always want it to be 7 days prior to the date in the first prompt?
Title: Re: JavaScript - Date Prompts - Dynamic/Onchange updation
Post by: cognosun on 04 Apr 2016 05:04:36 AM
It's a Date prompt too.
Title: Re: JavaScript - Date Prompts - Dynamic/Onchange updation
Post by: bdbits on 04 Apr 2016 10:11:38 AM
I think what BigChris is asking is: are you just being helpful to the user, or do you always want the second date to be 7 days earlier than the first? If it is always going to be the same 7 day offset, you don't need the prompt at all and you can simply make the calculation in your date filter/slicer.
Title: Re: JavaScript - Date Prompts - Dynamic/Onchange updation
Post by: BigChris on 05 Apr 2016 01:54:20 AM
You're right - that's exactly what I was asking  :D