We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Hide datepicker in javascript code

Thread ID:

Created:

Updated:

Platform:

Replies:

124290 May 30,2016 07:40 AM May 31,2016 10:13 AM ASP.NET Web Forms 1
loading
Tags: DatePicker
Manolo
Asked On May 30, 2016 07:40 AM

Hi,

I want hide/show a datepicker control in function dropdownlist value

<ej:DropDownList runat="server" ID="ddlTemporalidad" Value="2" ClientSideOnChange="onTemporalidadChange">

<ej:DatePicker runat="server" ID="dateDiario"></ej:DatePicker>


        function onTemporalidadChange(args)
        {
            switch(args.value)
            {
                case "1":
                    var obj = $("#<%=dateDiario.ClientID%>").data("ejDatePicker");
                    obj.show();                 
                    break;
                case "2":
                    var obj = $("#<%=dateDiario.ClientID%>").data("ejDatePicker");
                    obj.hide();                  
                    break;
                ...............
             }
        }


But it doesn't work

Francis Paul Antony Raj [Syncfusion]
Replied On May 31, 2016 10:13 AM

Hi Manolo, 
 
Thanks for contacting Syncfusion support. 
 
We have checked with your code snippet and tried with your code example. ClientSideOnChange event triggers properly when select the items in the dropdownlist and correspondingly datepicker show(), hide() method works. For your convenience, we have attached the sample in the below location. 
 
If still you face any difficulties, please check, 
#1) whether any script error thrown in console window. 
#2) whether ClientSideOnChange event triggers properly. 
#3) if triggers, check with the argument value (args.value), whether it is a string or integer type and changed the code accordingly. 
 
Please revert back the sample to reproduce the issue at our end, if still problem persists. 
 
Regards, 
Francis Paul A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;