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

Java script needed to validate 2 date prompts with current date

Started by dhanu, 24 May 2013 08:06:46 AM

Previous topic - Next topic

dhanu

Hi,

I have 2 date prompts in my Report  Start Date,End date  and 2 search select prompt (productline and product type)

If the user selects Start date> current date or  End Date > current date then
a pop message should Popup saying
'Please select start date lessthan current date  End date less than current date'

Thanks,
Dhanu  :)

rprameshwor

Hello Dhanu ,

A sample script that you can follow to get your work done is given below :

<script>
var fw=getFormWarpRequest();

fw.txtDatep_date.onchange=function() {  /// assumign the date prompt name is "p_date" and UI is "Edit Box"
var dt1=new Date(fw.txtDatep_date.value);
if (dt1 > new Date() ){                              // new Date() gives the current Day value as default
alert ('error');
}
}
</script>

** the onchange event doest seem to be fired when date is selected through a calendar , It works when user manually types in the date at the date prompt.



dhanu

Thanks rprameshwor!
as you said it work when user enter the date in edit box manually.
is there any way that can restrict the date not greater than current date from calendar prompt.
kindly let me know .