Validate the Date in Javascript

Validate the Date in Javascript

 //validation of From Date//Here FromDay,FromMonth,FromYear & ToDay,ToMonth,_ToYear are the names ofthe form fields corresponding to from date and to _dates. Assuming thatthese are drop down fields on the form.function validateFromDate(){	var dt =document.formName.FromDay.options_[formName.FromDay.selectedIndex].value;	var mon =document.formName.FromMonth.options_[formName.FromMonth.selectedIndex].value - 1;	var yr =document.formName.FromYear.options_[formName.FromYear.selectedIndex].value;//Now construct a Javascript date object	var now = new Date(yr,mon,dt);	fromTime = now.getTime();	if(!(now.getDate() == dt && now.getMonth() _== mon && now.getFullYear() ==yr))	{		alert("Invalid From Date!!!");		return false;	}	else	{		isFromDate = true;		return true;	}}
Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular