function checkdate() { var dt = document.getElementById("TextBox1").value; var currdt = new Date(); if (dt != null) { var myDate_array = dt.split("/"); var enteredDate1 = new Date(myDate_array[2], parseInt(myDate_array[1]) - 1, parseInt(myDate_array[0]) + 2); var today1 = new Date(); if (enteredDate1 < today1) { document.getElementById("TextBox1").value = "dd/MM/yyyy"; alert("Case File date must be greater than current date"); return false; } var enteredDate = new Date(myDate_array[2], parseInt(myDate_array[1]) - 1, myDate_array[0]); var today = new Date(); if (enteredDate > today) { document.getElementById("TextBox1").value = "dd/MM/yyyy"; alert("Case File date must be less than current date"); return false; } } }
<asp:TextBox ID="TextBox1" runat="server" onfocus="if(this.value=='dd/mm/yyyy') this.value='';" onblur="if(this.value=='') this.value='dd/mm/yyyy';" Text="dd/mm/yyyy" onchange="javascript:checkdate();"></asp:TextBox>
debugger;
var dt = document.getElementById('<%=TextBox1.ClientID%>');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)