javascript - onblur is getting called before textbox gets updated -
i have textbox date user can select date using datepicker.
i want know if date gets changed added onblur
textbox:
<asp:textbox runat="server" id="txtdate" cssclass="dateonly" width="80px" onblur="checkifdatechanged(this.value)" ></asp:textbox>
then in jquery wanted check date getting added alert:
function checkifdatechanged(date) { alert(date); }
the onblur
seems called before textbox changes new date. if current date 28/10/2016 , change 29/10/2016 alert shows 28/10/2016. date changes after close alert message.
how know if date gets changed when select new date datepicker?
you can use onselect
event.
$(".dateonly").datepicker({ onselect: function(date) { display("date: " + this.value); } });
read more https://api.jqueryui.com/datepicker/#option-onselect
Comments
Post a Comment