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
400
accessing webDateChooser on clien side
posted

Hi all,

I am trying to acces value of WebDateChooser from client side, but not getting value

 var dateChooser = igdrp_getComboById('<%= EndDate.ClientID %>');

var selectedDate = dateChooser.getValue();

my webDateChooser  is inside the webspiltter control.

Thanks

Shital


  • 28407
    posted

    HI,

     Make sure your control's name is EndDate.  Your WebDateChooser can have null values and therefore return null.

     I tested your code and it should work.

    Here is my page I used to test this out with.

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <%@ Register assembly="Infragistics2.WebUI.WebDateChooser.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebSchedule" tagprefix="igsch" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    <script language="javascript" type="text/javascript">
    // <!CDATA[

    function Button1_onclick() {
     var dc =  igdrp_getComboById('<%= WebDateChooser1.ClientID %>');
     var selectedDate = dc.getValue();
     alert(selectedDate);
    }

    // ]]>
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
       
            <igsch:WebDateChooser ID="WebDateChooser1" runat="server" ShowDropDown="True">
            </igsch:WebDateChooser>
       
        </div>
        </form>
        <p>
            <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /></p>
    </body>
    </html>