Comparision of two textboxes using Dates … Calendar Extendar in Asp.net with javascript

May 14, 2013

Comparision of two textboxes using Dates with calender extender and javascript

try this, it’s works for me.
function CheckValid(){

var fromDate = $(‘#<%=txtFromDt.ClientID %>’).val();
var toDate = $(‘#<%= txtTodt.ClientID %>’).val();
if ((fromDate != “” && toDate != “”) && Date.parse(fromDate) > Date.parse(toDate)) {
// alert(“To date should be greater than From date.”);
$(‘#<%= lblErrorMsg.ClientID %>’).text(‘To date should be greater than From date.’);
return false;
}
}

Advertisements