|
|
posted on December 29, 2014 06:48
Set value of a textbox to today's date using jQuery:
$("#<%= cbxLeaseSentToOwner.ClientID %>").click(function () {
var isChecked = $('#<%= cbxLeaseSentToOwner.ClientID %>').is(':checked');
if (isChecked) {
var myDate = new Date();
var prettyDate = (myDate.getMonth() + 1) + '/' + myDate.getDate() + '/' + myDate.getFullYear();
$("#<%= txtLeaseSentDate.ClientID %>").val(prettyDate);
}
else
{
$("#<%= txtLeaseSentDate.ClientID %>").val("");
}
});
There are currently no comments, be the first to post one!