0

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.");
        document.calldate.next_day.focus();
        return false;
    } 
}
</script>

Thank In Advance

Edited by mike_2000_17: Fixed formatting

3
Contributors
3
Replies
5
Views
9 Years
Discussion Span
Last Post by sahayata4u
0

Please check

Currect syntext is :

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

Rajeev

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.