So as part of inbuilt validation , if we enter 8/8/17 ---> Salesforce converts it to 8/8/2017 Similarly , if we enter 7/8/88 --->It becomes 7/8/1988 This occurs before SFDC code is even invoked .

Question - Can we have any validation in place(restricting year range) using the standard datepicker or we need to use jquery datepicker or JS?

  • This will depend if you would like to show a error on wrong date selection or would like to show only valid years for selection. – Mukesh Verma Feb 3 '17 at 9:28

Actually i was also facing the same issue. Actually when i was changing the date using date picker the date was changing successfully but when i was manually changing it, it was giving me the error you faced.Actually i associated onkeyup event with the input field taking date values. so i would suggest you not to associate onkeyup event with the date field if you have used use onchange event instead.

Thanks, Yogesh B. Patil

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.