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.
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:
Thanks alot brother for the instant reply and ya it did solved my issue. i'm really oblidged .
and last but not the least my Name is "H A M M A D" not Hamman.
Oh, sorry for that - next time I will be extra careful :) Glad I was able to help.