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

Reading value from DateTime prompt using Javascript

Started by horne47789, 08 Mar 2009 08:35:29 PM

Previous topic - Next topic

horne47789

Hi - I want to read the value from a date-time prompt and adjust it if necessary.  I know I can set it using pickerControlxxxx, but I haven't figured out how to read it when the user adjusts the value.  I've been experimenting with getElementsByTagName and can find the object but don't see any attributes which appear to have the currently selected date, nor can I figure out of there is a getDate() method or something similar I can call.

Any and all help is really appreciated.

Damian.

DanSev

If the date/time prompt (or date prompt) is not set, it would default to current date and 12:00 (Current date as is on your personal client machine, if you select it to change time it'll be current to complete clock settings.)

Here is some code to get to a date prompt (not date/time), it might prove helpful (the prompt name is called 'PromptDate'):
<script>
var dDate = new Date();
//Subtract one month
dDate.setMonth(dDate.getMonth()-1);
//Set to first of Month
dDate.setDate(1);
//setValue adjust current date in prompt
pickerControlPromptDate.setValue(getFormatDate(dDate, 0 , 'YMD'));
</script>

Include this in an html item after the date prompt. This script will assign the first of the previous month as the date ( Date: March 19th prompt would show Feb 1)

Gopinath

Try placing the date prompt parameter in a query as a data item, Create a hidden value prompt and assign the query to it. Set the parameter data item as USE and DISPLAY value. Now try reading the value of the hidden prompt using javascript.