I am trying to set a date of today to indicate user to input date in the textbox. To indicate this I have wrote this small javascript/jquery, and this is working in other test project but it is not working in my actual project. I am wondering what I have done wrong. Below is my script code:
$(document).ready(function () {
var dObj = new Date();
var foo = dObj.toLocaleDateString();
$("#dte").val(foo);
});
I am also confused about the position to attach a jquery link, whether it should be attach in .Master page or on content page before the corresponding close tag. Because when I attach this on master page it is giving me error like not able to find form1 and on latter one place it is not able to display the output in text box.
I have heard about placeholder and modernizer but it doesn't fulfil requirement of displaying date on page load. However, when ever I am giving value(date of today) to textbox inside Page_load method, i am not able to fetch the date that the user has selected. That is why I moved to this javascript solution. I am using AJAX date calendar extender to display calendar. Is it due to any ajax effect or something else.
please guide me regarding this.
Thanks!!