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
50
Web date Picker
posted

Hello,

I need to capture the web Date Picker selected value and use it in the javascript for validation purpose.

I am using the following code to ge the value, but I am getting error (Microsoft JScript runtime error: Object expected)

 

 

 

var

 

SartDate = '<%=StartDate.ClientID %>';

 

var frm1 = igdrp_getComboById(StartDate);

Any suggestions please.

Thanks in Advance

 

 

 

 

 

Parents
No Data
Reply
  • 24497
    posted

    Hi,

    It is not clear which control you refer to and what you mean under selected value.
    Considering codes
    var frm1 = igdrp_getComboById(StartDate);
    you probably use WebDateChooser, but not WebDatePicker.
    None of those controls have concept of selected value. They have only value (or text) which currently appears in edit field. Both of them also have method which returns part of selected string in edit field, but that is probably not what you ask for.

    If you want to know new selected date in drop-down calendar of WebDateChooser when it was dropped, then I can suggest you to process CalendarValueChanging event. Below is example:

    <script type="text/javascript">
    function dc1_CalendarValueChanging(oCalendar, oDate, oEvent){
     if(window.confirm('update?'))
      return;
     oEvent.cancel = true;
     var dc = igdrp_getComboById('<%=WebDateChooser1.ClientID%>');
    // dc.setDropDownVisible(false);
     dc.hideCalendar();
    }
    </script>
    <igsch:WebDateChooser ID="WebDateChooser1" runat="server">
     <ClientSideEvents CalendarValueChanging="dc1_CalendarValueChanging">
     </ClientSideEvents>
    </igsch:WebDateChooser>

Children