With JS add default date on TextBox
- by senzacionale
<asp:TextBox ID="txtDate" runat="server" AutoPostBack="true" OnTextChanged="txtDate_TextChanged"></asp:TextBox>
how can with Jquery add default date. I do not know where and when to call this code:
function addDefaultDate() {
if ($('#txtDate').val().length == 0) {
var now = new Date();
$('#txtDate').text(now.getDate() + '.' + now.getMonth() + '.' + now.getYear());
}
}