javascript to Enable rad date picker is not working in chrome and safari

6 posts, 0 answers
  1. Esther Nirmala
    Esther Nirmala avatar
    19 posts
    Member since:
    Apr 2010

    Posted 24 May 2011 Link to this post

    Hi,

        I have to disable rad datepicker if a checkbox is checked. if i uncheck the checkbox i have to enable the rad datepicker.. I am able to disable the date picker in all browsers. But i am not able to enable the same in firefox, chrome and safai.. it works in IE.  Is there any solution to avoid this?

    var CheckBoxNoExpiration = document.getElementById('<%= CheckBoxNoExpiration.ClientID %>');
                       var DatePicker = $find('<%= RadExpiryDate.ClientID %>');
                       var MandatoryMark = document.getElementById('<%= MandatoryMark.ClientID %>');
                       if (CheckBoxNoExpiration != null) {
                           if (CheckBoxNoExpiration.checked) {
                               if (MandatoryMark != null)
                                   MandatoryMark.style.display = 'none';
                               DatePicker.get_dateInput().disable();
                               DatePicker.get_dateInput.onclick = function() { return false; };
                               //onKeyDown = "javascript:return false;"
                               DatePicker._popupButton.disabled = true;
                               DatePicker._popupButton.onclick = function() { return false; };
                           }
                           else {
                               if (MandatoryMark != null)
                                   MandatoryMark.style.display = 'inline';
                               DatePicker.get_dateInput().enable();
                               DatePicker._popupButton.disabled = false;
                               DatePicker._popupButton.onclick = function() { DatePicker.togglePopup(); return false; };
                           }
                       }

    Thx
    Esther
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 26 May 2011 Link to this post

    Hi Esther,

    Find attached a very simple application which demonstrates similar scenario and works correctly in each browsers. I hope it helps.

    Regards,
    Maria Ilieva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 26 May 2011 Link to this post

    Hi Esther,

    Find attached a very simple application which demonstrates similar scenario and works correctly in each browsers. I hope it helps.

    Regards,
    Maria Ilieva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Clifton
    Clifton avatar
    4 posts
    Member since:
    Nov 2011

    Posted 08 Nov 2011 Link to this post

    Hi there, I have the same issue
    I done
    $find("<%= TxtRdpFromDate.ClientID %>").set_enabled(false);
     inside
      <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

    to disable or enable the following control
    <telerik:RadDatePicker ID="TxtRdpFromDate" runat="server">
                            </telerik:RadDatePicker>

    When using IE it works but under chrome or firefox it doesn't I tried to change the find to look like your example
    $find("TxtRdpFromDate").set_enabled(false);

    Any Idea??
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Nov 2011 Link to this post

    Hello Clifton,

    I tried to reproduce the issue but no avail. Here is the sample code.
    C#:
    protected void Page_Load(object sender, EventArgs e)
     {
     CheckBox1.Attributes.Add("onclick","clickon();");
     }

    JS:
    <script type="text/javascript">
      function clickon()
       {
          var chk = document.getElementById("CheckBox1");
          var dtpcr = $find("<%=RadDatePicker1.ClientID %>");
          if (chk.checked == true)
          {
             dtpcr.set_enabled(false);
          }
           else
          {
             dtpcr.set_enabled(true);
          }
       }
    </script>

    Thanks,
    Shinu.
  7. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 10 Nov 2011 Link to this post

    Hi Clifton,

    As we are not able to replicate the described issue on our side I would suggest you to open a regular support ticket and send us runnable version of your application which demonstrates the problematic behaviour. Thus we will be able to debug it locally and do our best to isolate the problem.

    Kind regards,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017