I’ve got an application that uses jQuery UI DatePicker on an ASP.NET textbox control.
The control is working as intended, but I’ve noticed that when you postback from a server call (via submit button), the entered value gets lost in the application.
Was wondering if you all have experienced this? What measures that you have to do to prevent this?
<asp:TextBox runat="server" ID="txtCallsMadeFrom" class="field" EnableViewState="true">
var callsMadeFromId = '#<%=txtCallsMadeFrom.ClientID %>';
jQuery(callsMadeFromId).datepicker({ showOn: "button", buttonImage: "../images/calendar.gif", altFormat: 'dd/mm/yy', buttonImageOnly: true, onSelect: function () { } });
You could consider saving the Textbox’s value in a hidden field. I do that with Jquery tabcontrols as they also forget which tab is selected during a postback.