Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2070
Reset Webdate chooser not working
posted

Hi

I have 2 webdate choosers in a page namely start date , end date. When the first time page loads start date highlights current date, month dropdown shows current month and year dropdown shows current year. First I changed the month to "March" and year to "2007". Then I have a button reset, there I set the value to null in server side as given below.

wbchStart.Value = null;

Using javscript in another page

 Now the start date month, year dropdowns shows the value selected previously(March,2007). Same case for end date also. But I want to reset the month, year dropdowns to what it is displayed(September,2009) while pageload. I want the solution to reset in javascript also.

 

 

 

How can I do this? I am using c#. I have posted the code below. Let me know if you need any more information. I need immediate help in this regard. Thanks in advance.

 <igsch:WebDateChooser Width="90px" ID="wbchStart" Section508Compliant ="true" runat="server" NullDateLabel="MM/DD/YYYY" CssClass ="date"> <ClientSideEvents InitializeDateChooser="InitProjectStartDateChooser" /></igsch:WebDateChooser >

function ResetDate() {

oStartTimeGenDateCt4.setValue(

null);

}

Parents
No Data
Reply
  • 24497
    posted

    Hi Slidhar,

    The setValue(null) should reset date in WebDateChooser on client. You may call that at any time: on init dateChooser, onload body and on any other event. Below is example:

    <script type="text/javascript">
    function resetDateChooser(oDateChooser)
    {
     oDateChooser.setValue(null);
    }
    function resetValue()
    {
     var dc = igdrp_getComboById('<%=WebDateChooser1.ClientID%>');
     if(dc)
      resetDateChooser(dc);
    }
    </script>
    <igsch:WebDateChooser ID="WebDateChooser1" runat="server" Value="2000-10-10">
     <ClientSideEvents InitializeDateChooser="resetDateChooser">
     </ClientSideEvents>
    </igsch:WebDateChooser>
    <input type="button" onclick="resetValue()" value="reset" />

Children