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

Date Prompt

Started by sg24, 12 Apr 2011 08:02:53 AM

Previous topic - Next topic

sg24

Hi,

I have a date prompt ( called end date) in my prompt page, and i need to validate the date when the user select end date <=getdate() , it has to alert a message saying "select a current or future date ' .
Please suggest how this can be achieved? I am using cognos 8.0 version.

Thanks in advance.

Thanks,
sg24

kattaviz

Hi,

You can do this using Javascript. Please see the below script.

<script type="text/javascript">
function CheckDate()
{
if (document.forms["formWarpRequest"].elements["XXX"].value
>document.forms["formWarpRequest"].elements["ZZZ"].value)
{
alert("Start date must be less than end date")
}
else
{
(promptButtonFinish())
}
}
</script>

Where XXX and ZZZ are the names of your date prompt controls.

HTH
thanks & regards
Satish Katta

sg24

Hi ,

Thank you for the response and code. But i have only one date propmt and i need to validate with getdate(). So i modified the code to

<html>
<head>
<script>
function DummyCheckSelection()
{
var dt= new Date();
var my_date= dt.getDate();
End_Date = document.formWarpRequest._oLstChoicesEndDate.value ;

if(End_Date<my_date)
{
alert('select );
}
return;

}
</script>
</head>
<body onclick = "DummyCheckSelection()">
</body>

here EndDate refers to date prompt name. This code doesn't work. Let me know if there is wrong anywhere.

Also when i display a message , how do i validate at the report level? Meaning the user should not be able to run the report if he selects the date which is less than today.

Any suggestions please let me knw.

Thanks,
Sg