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
120
Unable to Access value of WebDateChooser while Using MasterPage
posted

Hello, i'm using Infragistic WebDateChooser v 7.1 in my application, i am also using masterpages in my application. I've a scenario in which when date is changed in WDChooser control the year portion of the selected date has to be loaded in a dropdown.

i'm using the following javascript code to fetch the selected value in WDChooser using "OnBlur"  event but it doesn't work.

when i place the same function in another Webform that is not using  MasterPage it works absolutely perfect and displays the selected date. But i need it to work on Forms using MasterPages

<script type="text/javascript" language="javascript"> 

function test()
    {
        alert(document.getElementById('WebDateChooser1').value);                    
        return false;
   
    }

</script> 

Quick Response will be highly appreciated. 

Parents
No Data
Reply
  • 28464
    posted

    Hello Hamman,

    When using nested MasterPages / UserControls (INamingContainers) the ClientID and the server ID are different. I can suggest using the following syntax:

     

    document.getElementById("<%= WebDateChooser1.ClientID %>").value 

    or better yet, use the CSOM (client-side object model of the chooser) like that:

    var chooser = igdrp_getComboById('<%= WebDateChooser1.ClientID %>');
    alert(chooser.getValue());

    More info on CSOM in WebDateChooser can be found here:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR3.5/html/WebDateChooser_Object_CSOM.html
Children