Hi In my application page i have a sharepoint datetime control. I am using jquery on text changed event to calculate the number of days and displaying in a text box. Now i want to fire the same event when date is changed. But it is not working can you please help me.
<SharePoint:DateTimeControl ID="TStartDate" runat="server" DateOnly="true" UseTimeZoneAdjustment="false" LocaleId="2057"/>
<asp:TextBox ID="txtNoofDays" runat="server" Width="28px"></asp:TextBox>
<font color="#c00000">The Calculated Due Date is:</font><asp:TextBox ID="Txtdailyweekly" runat="server" style="margin-top: 8px"></asp:TextBox>
jquery
(document).ready(function () {
$('#' + '<%=this.txtNoofDays.ClientID %>').change(function calculateAdddays() {
var datepicker = $('#' + '<%=this.TStartDate.Controls[0].ClientID%>').val();
alert(datepicker);
var dmy = datepicker.split("/")
var joindate = new Date(
parseInt(
dmy[2], 10),
parseInt(dmy[1], 10) - 1,
parseInt(dmy[0], 10)
);
var alertdays = $('#' + '<%=this.txtNoofDays.ClientID%>').val();
alert(alertdays);
joindate.setDate(joindate.getDate() + parseInt(alertdays));
var x = "";
x = (
("0" + joindate.getDate()).slice(-2) + "/" +
("0" + (joindate.getMonth() + 1)).slice(-2) + "/" +
joindate.getFullYear()
);
alert(x);
$('#' + '<%=this.Txtdailyweekly.ClientID %>').val(x);
})
$('#' + '<%=this.TStartDate.Controls[0].ClientID%>').change(function () {
calculateAdddays();
alert("eventfired"); });
});