COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: everlearner on 27 Nov 2013 04:01:15 AM

Title: Java script for date prompt, need help
Post by: everlearner on 27 Nov 2013 04:01:15 AM
Hi gurus,
I have date prompt, where user can select from & to date. when i run the report, by default it is showing current date in FROM & To selection Boxes, i dont want to show the current date instead wanted to show enter date/select date. this can we do without script???
if not, can any one help me how to get it by java script.
thanks in adv
Title: Re: Java script for date prompt, need help
Post by: yogeswari on 27 Nov 2013 06:11:42 AM
Hi,

Try this. 

<script>
document.formWarpRequest.elements["txtDateSBDR"].value='select an date/enter an date';
</script>

where SBDR is an prompt name and set the Select UI property=Edit box.

thanks,
yogeswari.
Title: Re: Java script for date prompt, need help
Post by: everlearner on 27 Nov 2013 11:17:12 PM
Thanks for ur reply yogeshwari, i have tried what u provided,
after that in From box still it is showing current date, where as in To box it is showing the text what we provided,  i wanted to display the text in From also. how can i do this?
thanks in adv
Title: Re: Java script for date prompt, need help
Post by: yogeswari on 28 Nov 2013 05:15:01 AM
Hi,

It is quite simple.  please Apply the same to "From" also.

Example:
For "From Date:" use below script
<script>
document.formWarpRequest.elements["txtDateSBDR"].value='select an date/enter an date';
</script>

where SBDR-->prompt name and set the Select UI property=Edit box.



For "To Date:" Use below script
<script>
document.formWarpRequest.elements["txtDateEBDR"].value='select an date/enter an date';
</script>

where EBDR-->prompt name and  set the Select UI property=Edit box.


Thanks,
yogeswari.