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

Recommended Answers

All 3 Replies

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 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.