Snippets
29

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("");
                }

            });

Post Rating

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.

  120 OLD FREEMANS WAY, BREWSTER, MA 02631
  P. O. BOX 2342, BREWSTER, MA 02631
  (774) 323-3176
  CONTACT US