function DateCheck(element, name) { var dateString1 = (document.getElementById("<%= txtActiveTillDate.ClientID %>").value); var active = new Date(dateString1).getDate() + "-" + new Date(dateString1).getMonth() + "-" + new Date(dateString1).getFullYear(); var dateString2 = (document.getElementById("<%= txtPublishingDate.ClientID %>").value); var publishing = new Date(dateString2).getDate() + "-" + new Date(dateString2).getMonth() + "-" + new Date(dateString2).getFullYear(); var todaydate = new Date().getDate() + "-" + new Date().getMonth() + "-" + new Date().getFullYear(); if (active < todaydate) { alert('Active Till date must be greater than Today date.'); document.getElementById("<%= txtActiveTillDate.ClientID %>").value = ""; return; } if (publishing < todaydate) { alert('Publishing date must be greater or equal to Today date.'); document.getElementById("<%= txtPublishingDate.ClientID %>").value = ""; return; } if (publishing >= active) { alert('Active Till Date cannot be less than Publishing Date.'); document.getElementById("<%= txtActiveTillDate.ClientID %>").value = ""; return; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)