I have two date field viz from-date and to-date
and i want to validate that from-date should be less than or equal to to-date
using javascript. Note: date field should be in yy-mm-dd format
How is that possible ?
Please help me..
Thanks in advance..
Location: Splendora, Texas, United States of America
Posts: 2,887
Thanks: 5
Thanked 186 Times in 183 Posts
You can split the date into pieces then compare them part by part. It’ll be harder if you want to compare 1900 years with 2000 years in a yy format though.
Code:
var fromDateSplit = fromDate.split("-");
var toDateSplit = toDate.split("-");