Hello Friends ,
I m new in Javascript
i m trying to validate two date coming in the format DD-MON-YYYY coming through PopUP-Calendar in two textboxes but unable to get required result I musing following function:

<script type="text/javascript">
function check(){
  var SDate = document.form.previous_date.value;
var EDate = document.form.next_date.value;

if (SDate == '' || EDate == '') {
  alert("Plesae enter both....");
  return false;

var endDate =new Date.parse(EDate);
var startDate =new Date.parse.Date(SDate);

if(startDate > endDate)
        alert("Please ensure that the End Date is greater than or equal to the Start Date.");
        return false;

Thank In Advance

thank aravelli i really appreciate this ....

Please check

Currect syntext is :

var endDate =new Date.parse(EDate);
var startDate =new Date.parse(SDate);


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.