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
135
WebDateChooser: Select only Month/ Year
posted

Hello,

I am using the WebdateChooser, however for some objects i need to fixed the day to the 1st of the month. The user can't changed this.

I would like to have the following:

* The same layout, except the user can't change the Day (So only month and year change) with displaying the Day (1,2,3,4....28, 29, 30,31)

* Or leave the Day chooser out completely

How do I do that?

re  bert

Parents
  • 24497
    Verified Answer
    posted

    Hi Bert,

    WebDateChooser does not support similar feature. However, since it raises various events, it it relatively easy to implement. Below example will keep 1st day of month regardless to what user entered.

    <script type="text/javascript">
    function
    WebDateChooser1_ValueChanged(oDateChooser, newValue, oEvent)
    {
     
    if(!newValue)
      
    return;
     oDateChooser.setValue(
    new Date(newValue.getFullYear(), newValue.getMonth(), 1));
    }
    </script>

    <igsch:WebDateChooser ID="WebDateChooser1" runat="server">
     
    <ClientSideEvents ValueChanged="WebDateChooser1_ValueChanged"></ClientSideEvents>
    </igsch:WebDateChooser>

Reply Children
No Data