function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VarunSVarunS 

Difference between two date fields on VF Page using Javascript/Jquery

Hi Guys,

I have a Vf page which has two Input fields of date types one is Start date and other is end date, what i want is that if the difference between the end date and start date is greater than 7 i want to show an error. I am able to do the same via controller, but don't want this to happen on server side, therefor trying to do this on VF page using JavaScript or Jquery.
Any help would be appricaited

Thanks in advance !!
Gyanender SinghGyanender Singh
Hi VarunS,

Please send the code of your vf page and the controller and use ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,'************'));

in the cotroller and <apex:pageMessages ></apex:pageMessages> in the vf page and render the <apex:pageMessages ></apex:pageMessages>.

Thanks,
Gyanender Singh
07503868174