Help with date validation

Help with date validation

I am trying to make a validation alert when a user is entering a delivery date which is before the order date, I do however have the issue that I get the alert regardless if which date the user puts in.

Any ideas what is going wrong?

if (input.Delivery_date  <  input.Order_date)
{
}
alert("Invalid Delivery Date");


Thanks.