Javascript function for validating date

Rated 4.17/5 based on 581 customer reviews

Once that scripting is implemented, we’re actually only a couple of skips and hops away from a complete polyfill.

Such a script is beyond the scope of this article, but if you wanted to develop it further, all of the basic blocks are there – testing whether a field should be validated, validating a field against a pattern and/or required, and binding trigger events.

Folks on the forum may (rightfully) suggest looking at other PDI Steps to help with date validation before trying Java Script Step.

Can you update your post to help describe what you mean by "validate date"?

While working on a form validation project recently, I needed a way to validate if a date was actually valid or not.So i am looking to see if validation can be added using JS. Basically when a user clicks on Save button on the new item form, the code should check if Due date field is populated or not, if not then it should show a message in red that you cannot leave due date empty. * in the expanded folder, expand each set of functions for data types you're using (e.g.expanding Date Functions) * right click each function and select 'Sample' * PDI will open a hidden script sample that shows some example code Screenshot of this stuff in Java Script Step: Some more follow-up questions: * What is the data type of your input?

Leave a Reply